improve exception feedback a bit
[supertux.git] / src / resources.cpp
index 5527993..a39da2a 100644 (file)
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "app/globals.h"
+#include "special/sprite_manager.h"
+#include "audio/sound_manager.h"
+#include "app/setup.h"
+#include "gui/button.h"
 #include "scene.h"
 #include "player.h"
 #include "badguy.h"
 #include "gameobjs.h"
 #include "special.h"
 #include "resources.h"
-#include "special/sprite_manager.h"
-#include "audio/sound_manager.h"
-#include "app/setup.h"
 #include "door.h"
-#include "gui/button.h"
+#include "badguy_specs.h"
 
 Surface* img_waves[3]; 
 Surface* img_water;
@@ -74,7 +75,9 @@ char * soundfilenames[NUM_SOUNDS] = {
                                        "/sounds/lifeup.wav",
                                        "/sounds/stomp.wav",
                                        "/sounds/kick.wav",
-                                       "/sounds/explosion.wav"
+                                       "/sounds/explosion.wav",
+                                       "/sounds/warp.wav",
+                                       "/sounds/fireworks.wav"
                                     };
 
 
@@ -132,10 +135,10 @@ void loadshared()
     }
 
   small_tux = new TuxBodyParts();
-  small_tux->head = sprite_manager->load("big-tux-head");
-  small_tux->body = sprite_manager->load("big-tux-body");
-  small_tux->arms = sprite_manager->load("big-tux-arms");
-  small_tux->feet = sprite_manager->load("big-tux-feet");
+  small_tux->head = NULL;
+  small_tux->body = sprite_manager->load("small-tux-body");
+  small_tux->arms = sprite_manager->load("small-tux-arms");
+  small_tux->feet = NULL;
 
   big_tux = new TuxBodyParts();
   big_tux->head = sprite_manager->load("big-tux-head");
@@ -155,6 +158,9 @@ void loadshared()
   ice_tux->arms = sprite_manager->load("big-tux-arms");
   ice_tux->feet = sprite_manager->load("big-tux-feet");
 
+  /* Load Bad Guys resources */
+  badguyspecs_manager = new BadGuySpecsManager(datadir + "/badguys.strf");
+
   /* Water: */
   img_water = new Surface(datadir + "/images/shared/water.png", false);
 
@@ -211,10 +217,6 @@ void loadshared()
   img_cloud[1][3] = new Surface(datadir + "/images/shared/cloud-13.png",
                                 true);
 
-
-  /* Bad guys: */
-  load_badguy_gfx();
-
   /* Upgrades: */
   load_special_gfx();
 
@@ -284,7 +286,6 @@ void unloadshared(void)
   int i;
 
   free_special_gfx();
-  free_badguy_gfx();
 
   delete img_water;
   for (i = 0; i < 3; i++)