X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsupertux%2Fmain.cpp;h=4979871384ca0cabc063f727c4b2ea9379fb5bae;hb=e4fe001c2e244bcd86870d2a3d936c4eca59c576;hp=4f0bf22f5845b675d9444fc53a82d13cb14b32ef;hpb=08813a74da6ac1fd045a105e4e8105f1d7f716f0;p=supertux.git diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp index 4f0bf22f5..497987138 100644 --- a/src/supertux/main.cpp +++ b/src/supertux/main.cpp @@ -23,20 +23,26 @@ #ifdef MACOSX namespace supertux_apple { -} +# include +} // namespace supertux_apple #endif +#include "tinygettext/log.hpp" + #include "addon/addon_manager.hpp" #include "audio/sound_manager.hpp" #include "binreloc/binreloc.h" #include "control/joystickkeyboardcontroller.hpp" #include "math/random_generator.hpp" +#include "physfs/ifile_stream.hpp" #include "physfs/physfs_sdl.hpp" +#include "physfs/physfs_file_system.hpp" #include "scripting/squirrel_util.hpp" #include "supertux/gameconfig.hpp" +#include "supertux/globals.hpp" #include "supertux/mainloop.hpp" #include "supertux/resources.hpp" -#include "supertux/title.hpp" +#include "supertux/title_screen.hpp" #include "util/file_system.hpp" #include "util/gettext.hpp" #include "video/drawing_context.hpp" @@ -44,13 +50,6 @@ namespace supertux_apple { namespace { DrawingContext *context_pointer; } -SDL_Surface* g_screen; -JoystickKeyboardController* g_main_controller = 0; -TinyGetText::DictionaryManager dictionary_manager; - -int SCREEN_WIDTH; -int SCREEN_HEIGHT; - static void init_config() { g_config = new Config(); @@ -63,12 +62,15 @@ static void init_config() static void init_tinygettext() { + tinygettext::Log::set_log_info_callback(0); + dictionary_manager.set_filesystem(std::auto_ptr(new PhysFSFileSystem)); + 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( g_config->locale ); + dictionary_manager.set_language(tinygettext::Language::from_name(g_config->locale)); } } @@ -519,6 +521,16 @@ static inline void timelog(const char* ) } #endif +std::istream* physfs_open_file(const char* name) +{ + return new IFileStream(name); +} + +void physfs_free_list(char** name) +{ + PHYSFS_freeList(name); +} + int supertux_main(int argc, char** argv) { int result = 0;