#include "scripting/squirrel_util.hpp"
#include "supertux/gameconfig.hpp"
#include "supertux/globals.hpp"
-#include "supertux/mainloop.hpp"
+#include "supertux/screen_manager.hpp"
#include "supertux/resources.hpp"
#include "supertux/title_screen.hpp"
#include "util/file_system.hpp"
void
Main::init_tinygettext()
{
+ 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::auto_ptr<tinygettext::FileSystem>(new PhysFSFileSystem));
- dictionary_manager.add_directory("locale");
- dictionary_manager.set_charset("UTF-8");
+ dictionary_manager->add_directory("locale");
+ dictionary_manager->set_charset("UTF-8");
// Config setting "locale" overrides language detection
- if (g_config->locale != "") {
- dictionary_manager.set_language(tinygettext::Language::from_name(g_config->locale));
+ if (g_config->locale != "")
+ {
+ dictionary_manager->set_language(tinygettext::Language::from_name(g_config->locale));
}
}
SDL_WM_SetIcon(icon, 0);
SDL_FreeSurface(icon);
}
-#ifdef DEBUG
+#ifndef NDEBUG
else {
log_warning << "Couldn't load icon '" << icon_fname << "'" << std::endl;
}
while(SDL_PollEvent(&event)) {
switch(event.type) {
case SDL_QUIT:
- g_main_loop->quit();
+ g_screen_manager->quit();
break;
case SDL_KEYDOWN:
case SDL_JOYBUTTONDOWN:
}
}
-#ifdef DEBUG
+#ifndef NDEBUG
static Uint32 last_timelog_ticks = 0;
static const char* last_timelog_component = 0;
timelog(0);
- g_main_loop = new MainLoop();
+ g_screen_manager = new ScreenManager();
if(g_config->start_level != "") {
// we have a normal path specified at commandline, not a physfs path.
// So we simply mount that path here...
if(g_config->start_level.size() > 4 &&
g_config->start_level.compare(g_config->start_level.size() - 5, 5, ".stwm") == 0) {
init_rand();
- g_main_loop->push_screen(new WorldMapNS::WorldMap(
+ g_screen_manager->push_screen(new WorldMapNS::WorldMap(
FileSystem::basename(g_config->start_level)));
} else {
init_rand();//If level uses random eg. for
if(g_config->record_demo != "")
session->record_demo(g_config->record_demo);
- g_main_loop->push_screen(session.release());
+ g_screen_manager->push_screen(session.release());
}
} else {
init_rand();
- g_main_loop->push_screen(new TitleScreen());
+ g_screen_manager->push_screen(new TitleScreen());
}
//init_rand(); PAK: this call might subsume the above 3, but I'm chicken!
- g_main_loop->run(context);
+ g_screen_manager->run(context);
} catch(std::exception& e) {
log_fatal << "Unexpected exception: " << e.what() << std::endl;
result = 1;
result = 1;
}
- delete g_main_loop;
- g_main_loop = NULL;
+ delete g_screen_manager;
+ g_screen_manager = NULL;
Resources::unload_shared();
quit_audio();