- removed local (un)loadshared() stuff and replaced it my a global one, fixes crash...
authorIngo Ruhnke <grumbel@gmx.de>
Sun, 11 Apr 2004 16:58:06 +0000 (16:58 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Sun, 11 Apr 2004 16:58:06 +0000 (16:58 +0000)
SVN-Revision: 482

src/gameloop.cpp
src/leveleditor.cpp
src/supertux.cpp
src/title.cpp

index 80cd1d6..ac275dc 100644 (file)
@@ -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;
index d40fa64..c6fe850 100644 (file)
@@ -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();
 }
 
index 73991fe..b4da511 100644 (file)
@@ -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();
         }
     }
   
index deddd5a..9b1b175 100644 (file)
@@ -146,7 +146,6 @@ bool title(void)
   st_pause_ticks_init();
 
   GameSession session(datadir + "/levels/misc/menu.stl");
-  loadshared();
 
   //FIXME:activate_particle_systems();