X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsupertux.cpp;h=81856f6e638e6778afad4a15a3e975ca94e42fe5;hb=6f988a2dfbe4de1096a5ca6a4b30e7fc5355316c;hp=00fd2e1ad39ff7395e213f4b5c980790daf60e10;hpb=e43b147d6a1557b535b035ef5c8c4a3a1cb898f1;p=supertux.git diff --git a/src/supertux.cpp b/src/supertux.cpp index 00fd2e1ad..81856f6e6 100644 --- a/src/supertux.cpp +++ b/src/supertux.cpp @@ -17,44 +17,45 @@ // 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 "exceptions.h" #include "defines.h" -#include "globals.h" -#include "setup.h" +#include "app/globals.h" +#include "app/setup.h" #include "intro.h" #include "title.h" #include "gameloop.h" #include "leveleditor.h" -#include "screen/screen.h" +#include "video/screen.h" #include "worldmap.h" #include "resources.h" -#include "screen/surface.h" +#include "video/surface.h" #include "tile_manager.h" -#include "gettext.h" +#include "app/gettext.h" +#include "misc.h" +#include "utils/configfile.h" int main(int argc, char * argv[]) { #ifndef DEBUG try { #endif - setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); - textdomain(PACKAGE); - bind_textdomain_codeset(PACKAGE, "ISO-8859-1"); - - st_directory_setup(); - parseargs(argc, argv); + config = new MyConfig; + + 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(); @@ -89,24 +90,15 @@ int main(int argc, char * argv[]) title(); } - SDL_FillRect(screen, 0, 0); - //SDL_Flip(screen); - unloadshared(); - st_general_free(); - TileManager::destroy_instance(); - #ifdef DEBUG + Setup::general_free(); + st_menu_free(); +#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) - { - 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