log_warning << "Unknown token '" << token << "' in Add-on list" << std::endl;
continue;
}
- std::auto_ptr<Addon> addon(new Addon());
+ std::unique_ptr<Addon> addon(new Addon());
addon->parse(*(iter.lisp()));
addon->installed = false;
addon->loaded = false;
{
assert(sound_enabled);
- std::auto_ptr<OpenALSoundSource> source (new OpenALSoundSource());
+ std::unique_ptr<OpenALSoundSource> source (new OpenALSoundSource());
ALuint buffer;
buffer = i->second;
} else {
// Load sound file
- std::auto_ptr<SoundFile> file (load_sound_file(filename));
+ std::unique_ptr<SoundFile> file (load_sound_file(filename));
if(file->size < 100000) {
buffer = load_file_into_buffer(file.get());
if(i != buffers.end())
return;
try {
- std::auto_ptr<SoundFile> file (load_sound_file(filename));
+ std::unique_ptr<SoundFile> file (load_sound_file(filename));
// only keep small files
if(file->size >= 100000)
return;
return;
try {
- std::auto_ptr<OpenALSoundSource> source
+ std::unique_ptr<OpenALSoundSource> source
(intern_create_sound_source(filename));
if(pos.x < 0 || pos.y < 0) {
}
try {
- std::auto_ptr<StreamSoundSource> newmusic (new StreamSoundSource());
+ std::unique_ptr<StreamSoundSource> newmusic (new StreamSoundSource());
newmusic->set_sound_file(load_sound_file(filename));
newmusic->set_looping(true);
newmusic->set_relative(true);
bool grabbed;
MovingObject* grabber;
- std::auto_ptr<SoundSource> ticking;
+ std::unique_ptr<SoundSource> ticking;
private:
Bomb(const Bomb&);
protected:
const BadGuy* parent; /**< collisions with this BadGuy will be ignored */
- std::auto_ptr<SoundSource> sound_source; /**< SoundSource for ambient sound */
+ std::unique_ptr<SoundSource> sound_source; /**< SoundSource for ambient sound */
private:
Dart(const Dart&);
Color light;
SpritePtr lightsprite;
- std::auto_ptr<SoundSource> sound_source;
+ std::unique_ptr<SoundSource> sound_source;
};
#endif
bool grabbed;
MovingObject* grabber;
- std::auto_ptr<SoundSource> ticking;
+ std::unique_ptr<SoundSource> ticking;
};
#endif
bool is_stunned;
float time_stunned;
- std::auto_ptr<SoundSource> ticking;
- std::auto_ptr<SoundSource> grunting;
+ std::unique_ptr<SoundSource> ticking;
+ std::unique_ptr<SoundSource> grunting;
};
#endif /* HEADER_SUPERTUX_BADGUY_HAYWIRE_HPP */
float radius;
float speed;
- std::auto_ptr<SoundSource> sound_source;
+ std::unique_ptr<SoundSource> sound_source;
GhostTree* tree;
Vector suck_target;
std::string target_spawnpoint;
std::string hit_script;
- std::auto_ptr<SoundSource> sound_source;
+ std::unique_ptr<SoundSource> sound_source;
- std::auto_ptr<Path> path;
- std::auto_ptr<PathWalker> walker;
+ std::unique_ptr<Path> path;
+ std::unique_ptr<PathWalker> walker;
float flyspeed;
float track_range;
Vector cached_translation;
// autoscroll mode
- std::auto_ptr<Path> autoscroll_path;
- std::auto_ptr<PathWalker> autoscroll_walker;
+ std::unique_ptr<Path> autoscroll_path;
+ std::unique_ptr<PathWalker> autoscroll_walker;
// shaking
Timer shaketimer;
}
private:
- std::auto_ptr<Path> path;
- std::auto_ptr<PathWalker> walker;
+ std::unique_ptr<Path> path;
+ std::unique_ptr<PathWalker> walker;
Vector speed;
bool deactivated;
Controller* controller;
- std::auto_ptr<CodeController> scripting_controller; /**< This controller is used when the Player is controlled via scripting */
+ std::unique_ptr<CodeController> scripting_controller; /**< This controller is used when the Player is controlled via scripting */
PlayerStatus* player_status;
bool duck;
bool dead;
return files;
}
-std::auto_ptr<std::istream>
+std::unique_ptr<std::istream>
PhysFSFileSystem::open_file(const std::string& filename)
{
- return std::auto_ptr<std::istream>(new IFileStream(filename));
+ return std::unique_ptr<std::istream>(new IFileStream(filename));
}
/* EOF */
PhysFSFileSystem();
std::vector<std::string> open_directory(const std::string& pathname);
- std::auto_ptr<std::istream> open_file(const std::string& filename);
+ std::unique_ptr<std::istream> open_file(const std::string& filename);
};
#endif
throw std::runtime_error(msg.str());
}
- std::auto_ptr<SpriteData> data (
+ std::unique_ptr<SpriteData> data (
new SpriteData(*sprite, FileSystem::dirname(filename)) );
sprites[filename] = data.release();
void on_escape_press();
void process_menu();
- std::auto_ptr<Level> level;
+ std::unique_ptr<Level> level;
SurfacePtr statistics_backdrop;
// scripts
std::istream* playback_demo_stream;
CodeController* demo_controller;
- std::auto_ptr<Menu> game_menu;
+ std::unique_ptr<Menu> game_menu;
float play_time; /**< total time in seconds that this session ran interactively */
{
dictionary_manager = new tinygettext::DictionaryManager();
tinygettext::Log::set_log_info_callback(0);
- dictionary_manager->set_filesystem(std::auto_ptr<tinygettext::FileSystem>(new PhysFSFileSystem));
+ dictionary_manager->set_filesystem(std::unique_ptr<tinygettext::FileSystem>(new PhysFSFileSystem));
dictionary_manager->add_directory("locale");
dictionary_manager->set_charset("UTF-8");
SDL_SetWindowIcon(Renderer::instance()->get_window(), icon);
SDL_FreeSurface(icon);
}
- SDL_ShowCursor(0);
+ //SDL_ShowCursor(0);
log_info << (g_config->use_fullscreen?"fullscreen ":"window ")
<< " Window: " << g_config->window_size
return 0;
timelog("video");
- std::auto_ptr<Renderer> renderer(VideoSystem::new_renderer());
- std::auto_ptr<Lightmap> lightmap(VideoSystem::new_lightmap());
+ std::unique_ptr<Renderer> renderer(VideoSystem::new_renderer());
+ std::unique_ptr<Lightmap> lightmap(VideoSystem::new_lightmap());
DrawingContext context(*renderer, *lightmap);
context_pointer = &context;
init_video();
timelog(0);
- const std::auto_ptr<PlayerStatus> default_playerstatus(new PlayerStatus());
+ const std::unique_ptr<PlayerStatus> default_playerstatus(new PlayerStatus());
g_screen_manager = new ScreenManager();
g_screen_manager->push_screen(new worldmap::WorldMap(
FileSystem::basename(g_config->start_level), default_playerstatus.get()));
} else {
- std::auto_ptr<GameSession> session (
+ std::unique_ptr<GameSession> session (
new GameSession(FileSystem::basename(g_config->start_level), default_playerstatus.get()));
g_config->random_seed =session->get_demo_random_seed(g_config->start_demo);
{
try
{
- std::auto_ptr<World> world (new World());
+ std::unique_ptr<World> world (new World());
world->load(*it + "/info");
if (!world->hide_from_contribs)
{
class ContribMenu : public Menu
{
private:
- std::auto_ptr<ContribWorldMenu> m_contrib_world_menu;
+ std::unique_ptr<ContribWorldMenu> m_contrib_world_menu;
std::vector<World*> m_contrib_worlds;
public:
class MainMenu : public Menu
{
private:
- std::auto_ptr<AddonMenu> m_addon_menu;
- std::auto_ptr<ContribMenu> m_contrib_menu;
- std::auto_ptr<World> m_main_world;
+ std::unique_ptr<AddonMenu> m_addon_menu;
+ std::unique_ptr<ContribMenu> m_contrib_menu;
+ std::unique_ptr<World> m_main_world;
public:
MainMenu();
void check_menu();
protected:
- std::auto_ptr<LanguageMenu> language_menu;
+ std::unique_ptr<LanguageMenu> language_menu;
};
#endif
bool nextpush;
/// measured fps
float fps;
- std::auto_ptr<Screen> next_screen;
- std::auto_ptr<Screen> current_screen;
- std::auto_ptr<Console> console;
- std::auto_ptr<ScreenFade> screen_fade;
+ std::unique_ptr<Screen> next_screen;
+ std::unique_ptr<Screen> current_screen;
+ std::unique_ptr<Console> console;
+ std::unique_ptr<ScreenFade> screen_fade;
std::vector<Screen*> screen_stack;
bool screenshot_requested; /**< true if a screenshot should be taken after the next frame has been rendered */
};
if(i != tilesets.end())
return i->second;
- std::auto_ptr<TileSet> tileset (new TileSet(filename));
+ std::unique_ptr<TileSet> tileset (new TileSet(filename));
tilesets.insert(std::make_pair(filename, tileset.get()));
return tileset.release();
TileSet* TileManager::parse_tileset_definition(const Reader& reader)
{
- std::auto_ptr<TileSet> result(new TileSet());
+ std::unique_ptr<TileSet> result(new TileSet());
lisp::ListIterator iter(&reader);
while(iter.next()) {
if(images)
imagespecs = parse_tile_images(*images);
- std::auto_ptr<Tile> tile(new Tile(imagespecs, editor_imagespecs, attributes, data, fps));
+ std::unique_ptr<Tile> tile(new Tile(imagespecs, editor_imagespecs, attributes, data, fps));
if (id >= m_tileset.tiles.size())
m_tileset.tiles.resize(id+1, 0);
editor_imagespecs.push_back(Tile::ImageSpec(m_tiles_path + *j, Rectf(x, y, x + 32, y + 32)));
}
- std::auto_ptr<Tile> tile(new Tile(imagespecs, editor_imagespecs,
+ std::unique_ptr<Tile> tile(new Tile(imagespecs, editor_imagespecs,
(has_attributes ? attributes[i] : 0), (has_datas ? datas[i] : 0), fps));
if (m_tileset.tiles[ids[i]] == 0) {
m_tileset.tiles[ids[i]] = tile.release();
void generate_main_menu();
private:
- std::auto_ptr<MainMenu> main_menu;
+ std::unique_ptr<MainMenu> main_menu;
SurfacePtr frame;
- std::auto_ptr<CodeController> controller;
- std::auto_ptr<GameSession> titlesession;
+ std::unique_ptr<CodeController> controller;
+ std::unique_ptr<GameSession> titlesession;
std::string copyright_text;
private:
HSQOBJECT world_thread;
std::string title;
std::string description;
- std::auto_ptr<PlayerStatus> player_status;
+ std::unique_ptr<PlayerStatus> player_status;
public:
bool hide_from_contribs;
/** This class behaves like a pointer to a refcounted object, but increments the
* reference count when new objects are assigned and decrements the refcounter
- * when its lifetime has expired. (similar to std::auto_ptr)
+ * when its lifetime has expired. (similar to std::unique_ptr)
*/
template<typename T>
class Ref
}
*/
- get_level_target_time(*level);
+ if (level->target_time == 0.0f)
+ get_level_target_time(*level);
level->statistics.draw_worldmap_info(context, level->target_time);
break;
}
static WorldMap* current_;
- std::auto_ptr<Menu> worldmap_menu;
+ std::unique_ptr<Menu> worldmap_menu;
Vector camera_offset;