X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsupertux.cpp;h=23a3fcf214eaa89a8b21e8576a2216f09e8b7e68;hb=5a542dea3c6043703683b68fcaa774f6cb0d9127;hp=3181f3204916ab3e604af986f2e71fccaf4e88cd;hpb=236df51d91f0845cd4e06b3269e262911d81f5db;p=supertux.git diff --git a/src/supertux.cpp b/src/supertux.cpp index 3181f3204..23a3fcf21 100644 --- a/src/supertux.cpp +++ b/src/supertux.cpp @@ -17,14 +17,16 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. +#include #include #include #include #include +#include #include "utils/exceptions.h" -#include "app/defines.h" +#include "defines.h" #include "app/globals.h" #include "app/setup.h" #include "intro.h" @@ -47,18 +49,15 @@ int main(int argc, char * argv[]) try { #endif config = new MyConfig; - setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); - textdomain(PACKAGE); - bind_textdomain_codeset(PACKAGE, "ISO-8859-1"); - - st_directory_setup(); - parseargs(argc, argv); + + Setup::init(PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION); + + Setup::parseargs(argc, argv); - st_audio_setup(); - st_video_setup(); - st_joystick_setup(); - st_general_setup(); + Setup::audio(); + Setup::video(800, 600); + Setup::joystick(); + Setup::general(); st_menu(); loadshared(); @@ -93,25 +92,18 @@ int main(int argc, char * argv[]) title(); } - SDL_FillRect(screen, 0, 0); - //SDL_Flip(screen); - unloadshared(); - st_general_free(); + Setup::general_free(); st_menu_free(); TileManager::destroy_instance(); - #ifdef DEBUG +#ifdef DEBUG Surface::debug_check(); - #endif - st_shutdown(); +#endif + Termination::shutdown(); #ifndef DEBUG // we want to see the backtrace in gdb when in debug mode - } - catch (SuperTuxException &e) - { + } catch (SuperTuxException &e) { std::cerr << "Unhandled SuperTux exception:\n " << e.what_file() << ":" << e.what_line() << ": " << e.what() << std::endl; - } - catch (std::exception &e) - { + } catch (std::exception &e) { std:: cerr << "Unhandled exception: " << e.what() << std::endl; } #endif