From: Ingo Ruhnke Date: Sun, 11 Apr 2004 16:58:06 +0000 (+0000) Subject: - removed local (un)loadshared() stuff and replaced it my a global one, fixes crash... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e3d8e801e0cc2d176d88c0a56a424dfad03277ca;p=supertux.git - removed local (un)loadshared() stuff and replaced it my a global one, fixes crash on entering a level twice SVN-Revision: 482 --- diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 80cd1d6a1..ac275dc54 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -104,7 +104,6 @@ GameSession::GameSession(const std::string& subset_, int levelnb_, int mode) } world->get_level()->load_gfx(); - loadshared(); world->activate_bad_guys(); world->activate_particle_systems(); @@ -363,7 +362,6 @@ GameSession::action(double frame_ratio) world->get_level()->free_song(); world->arrays_free(); - unloadshared(); return(0); } tux.level_begin(); @@ -390,7 +388,6 @@ GameSession::action(double frame_ratio) world->get_level()->free_song(); world->arrays_free(); - unloadshared(); return(0); } /* if (lives < 0) */ } @@ -640,7 +637,6 @@ GameSession::run() world->get_level()->cleanup(); world->get_level()->free_song(); - unloadshared(); world->arrays_free(); return quit; diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index d40fa6473..c6fe850d5 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -242,7 +242,6 @@ int leveleditor(int levelnb) leveleditor_menu->item[3].kind = MN_GOTO; le_level = 1; global_world.arrays_free(); - loadshared(); le_current_level = new Level; if(le_current_level->load(le_level_subset.name.c_str(), le_level) != 0) { @@ -273,7 +272,6 @@ int leveleditor(int levelnb) leveleditor_menu->item[3].kind = MN_GOTO; le_level = 1; global_world.arrays_free(); - loadshared(); le_current_level = new Level; if(le_current_level->load(le_level_subset.name.c_str(), le_level) != 0) { @@ -595,7 +593,6 @@ void le_quit(void) le_current_level->free_gfx(); le_current_level->cleanup(); global_world.arrays_free(); - unloadshared(); } } @@ -1194,7 +1191,6 @@ void le_testlevel() Menu::set_current(leveleditor_menu); global_world.arrays_free(); le_current_level->load_gfx(); - loadshared(); global_world.activate_bad_guys(); } diff --git a/src/supertux.cpp b/src/supertux.cpp index 73991fe1c..b4da51170 100644 --- a/src/supertux.cpp +++ b/src/supertux.cpp @@ -11,9 +11,7 @@ */ #include "supertux.h" - - -/* --- MAIN --- */ +#include "resources.h" int main(int argc, char * argv[]) { @@ -42,7 +40,9 @@ int main(int argc, char * argv[]) done = false; while (!done) { + loadshared(); done = title(); + unloadshared(); } } diff --git a/src/title.cpp b/src/title.cpp index deddd5a97..9b1b175a7 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -146,7 +146,6 @@ bool title(void) st_pause_ticks_init(); GameSession session(datadir + "/levels/misc/menu.stl"); - loadshared(); //FIXME:activate_particle_systems();