From: Ricardo Cruz Date: Sat, 14 Aug 2004 11:33:53 +0000 (+0000) Subject: Removed trampoline sprites hack. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=bb1bc5a5db8e4e81646b3a006e8f8b5931cf1d2b;p=supertux.git Removed trampoline sprites hack. SVN-Revision: 1774 --- diff --git a/src/gameobjs.cpp b/src/gameobjs.cpp index 95e544a1c..ccd9b83ea 100644 --- a/src/gameobjs.cpp +++ b/src/gameobjs.cpp @@ -137,7 +137,7 @@ FloatingScore::draw(DrawingContext& context) /* Trampoline */ -Sprite *img_trampoline[TRAMPOLINE_FRAMES]; +Sprite *img_trampoline; Trampoline::Trampoline(LispReader& reader) { @@ -181,7 +181,8 @@ Trampoline::write(LispWriter& writer) void Trampoline::draw(DrawingContext& context) { - img_trampoline[frame]->draw(context, base, LAYER_OBJECTS); + img_trampoline->set_frame(frame); + img_trampoline->draw(context, base, LAYER_OBJECTS); frame = 0; } @@ -438,15 +439,7 @@ SmokeCloud::draw(DrawingContext& context) void load_object_gfx() { - char sprite_name[16]; - - for (int i = 0; i < TRAMPOLINE_FRAMES; i++) - { - sprintf(sprite_name, "trampoline-%i", i+1); - img_trampoline[i] = sprite_manager->load(sprite_name); - } - + img_trampoline = sprite_manager->load("trampoline"); img_flying_platform = sprite_manager->load("flying_platform"); - img_smoke_cloud = sprite_manager->load("stomp"); } diff --git a/src/gameobjs.h b/src/gameobjs.h index 9112cae0c..04665be98 100644 --- a/src/gameobjs.h +++ b/src/gameobjs.h @@ -105,8 +105,7 @@ private: Timer timer; }; -#define TRAMPOLINE_FRAMES 4 -extern Sprite *img_trampoline[TRAMPOLINE_FRAMES]; +extern Sprite *img_trampoline; class Trampoline : public MovingObject, public Serializable {