Limitated the number of bullets to be shot at the same time.
[supertux.git] / src / resources.cpp
index 9abc401..6242953 100644 (file)
@@ -1,3 +1,22 @@
+//  $Id$
+//
+//  SuperTux -  A Jump'n Run
+//  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
 #include "globals.h"
 #include "scene.h"
 #include "player.h"
@@ -75,27 +94,11 @@ void loadshared()
   cape_left[1] = new Surface(datadir + "/images/shared/cape-left-1.png",
                USE_ALPHA);
 
-  bigtux_right[0] = new Surface(datadir + "/images/shared/bigtux-right-0.png",
-               USE_ALPHA);
-
-  bigtux_right[1] = new Surface(datadir + "/images/shared/bigtux-right-1.png",
-               USE_ALPHA);
-
-  bigtux_right[2] = new Surface(datadir + "/images/shared/bigtux-right-2.png",
-               USE_ALPHA);
-
-  bigtux_right_jump = new Surface(datadir + "/images/shared/bigtux-right-jump.png", USE_ALPHA);
-
-  bigtux_left[0] = new Surface(datadir + "/images/shared/bigtux-left-0.png",
-               USE_ALPHA);
-
-  bigtux_left[1] = new Surface(datadir + "/images/shared/bigtux-left-1.png",
-               USE_ALPHA);
-
-  bigtux_left[2] = new Surface(datadir + "/images/shared/bigtux-left-2.png",
-               USE_ALPHA);
+  bigtux_right = sprite_manager->load("largetux-walk-right");
+  bigtux_left  = sprite_manager->load("largetux-walk-left");
 
-  bigtux_left_jump = new Surface(datadir + "/images/shared/bigtux-left-jump.png", USE_ALPHA);
+  bigtux_left_jump  = sprite_manager->load("largetux-jump-left");
+  bigtux_right_jump = sprite_manager->load("largetux-jump-right");
 
   bigcape_right[0] = new Surface(datadir + "/images/shared/bigcape-right-0.png",
                USE_ALPHA);
@@ -144,13 +147,8 @@ void loadshared()
                USE_ALPHA);
 
 
-  ducktux_right = new Surface(datadir +
-               "/images/shared/tux-duck-right.png",
-               USE_ALPHA);
-
-  ducktux_left = new Surface(datadir +
-               "/images/shared/tux-duck-left.png",
-               USE_ALPHA);
+  ducktux_left  = sprite_manager->load("largetux-duck-left");
+  ducktux_right = sprite_manager->load("largetux-duck-right");
 
   skidtux_right = new Surface(datadir +
                "/images/shared/skidtux-right.png",
@@ -302,8 +300,6 @@ void unloadshared(void)
     {
       delete tux_right[i];
       delete tux_left[i];
-      delete bigtux_right[i];
-      delete bigtux_left[i];
     }
 
   delete bigtux_right_jump;