+// $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"
#include "gameobjs.h"
#include "special.h"
#include "resources.h"
+#include "sprite_manager.h"
Surface* img_waves[3];
Surface* img_water;
Surface* img_box_empty;
Surface* img_red_glow;
+SpriteManager* sprite_manager = 0;
+
/* Load graphics/sounds shared between all levels: */
void loadshared()
{
int i;
+ sprite_manager = new SpriteManager(datadir + "/supertux.strf");
+
/* Tuxes: */
smalltux_stand_left = new Surface(datadir + "/images/shared/smalltux-left-6.png", USE_ALPHA);
smalltux_stand_right = new Surface(datadir + "/images/shared/smalltux-right-6.png", USE_ALPHA);
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 = sprite_manager->load("largetux-walk-right");
+ bigtux_left = sprite_manager->load("largetux-walk-left");
- 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_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);
USE_ALPHA);
- ducktux_right = new Surface(datadir +
- "/images/shared/ducktux-right.png",
- USE_ALPHA);
-
- ducktux_left = new Surface(datadir +
- "/images/shared/ducktux-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",
/* Free shared data: */
void unloadshared(void)
{
+ delete sprite_manager;
+
int i;
free_special_gfx();
{
delete tux_right[i];
delete tux_left[i];
- delete bigtux_right[i];
- delete bigtux_left[i];
}
delete bigtux_right_jump;