]> git.localhorst.tv Git - l2e.git/commitdiff
changed number animation prototype to plain animation pointer
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 20 Aug 2012 21:52:47 +0000 (23:52 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 20 Aug 2012 21:52:47 +0000 (23:52 +0200)
src/battle/Resources.h
src/main.cpp

index 5e68281548b4e1bc8cef7b9de7d01bb22a7cc62b..49d30c1fd49bf7693fcae0deeecd7a7e0a8c993d 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef BATTLE_RESOURCES_H_
 #define BATTLE_RESOURCES_H_
 
 #ifndef BATTLE_RESOURCES_H_
 #define BATTLE_RESOURCES_H_
 
-#include "../graphics/ComplexAnimation.h"
 #include "../graphics/Menu.h"
 
 #include <SDL.h>
 #include "../graphics/Menu.h"
 
 #include <SDL.h>
@@ -19,6 +18,7 @@ namespace common {
        class Spell;
 }
 namespace graphics {
        class Spell;
 }
 namespace graphics {
+       class Animation;
        class Font;
        class Frame;
        class Gauge;
        class Font;
        class Frame;
        class Gauge;
@@ -72,7 +72,7 @@ struct Resources {
 
        const char *escapeText;
 
 
        const char *escapeText;
 
-       graphics::ComplexAnimation numberAnimationPrototype;
+       const graphics::Animation *numberAnimationPrototype;
 
        const graphics::Sprite *bigNumberSprite;
        const graphics::Sprite *greenNumberSprite;
 
        const graphics::Sprite *bigNumberSprite;
        const graphics::Sprite *greenNumberSprite;
@@ -137,6 +137,7 @@ struct Resources {
 
        , escapeText("")
 
 
        , escapeText("")
 
+       , numberAnimationPrototype(0)
        , bigNumberSprite(0)
        , greenNumberSprite(0)
 
        , bigNumberSprite(0)
        , greenNumberSprite(0)
 
index 8325163ef61c435ec662e2d0e0c8f96c74cbe018..2901874172052e95fd7234e6787465b9777cf801 100644 (file)
@@ -263,29 +263,30 @@ int main(int argc, char **argv) {
                Font largeFont(&largeFontSprite, 0, -2);
                battleRes.titleFont = &largeFont;
 
                Font largeFont(&largeFontSprite, 0, -2);
                battleRes.titleFont = &largeFont;
 
-               battleRes.numberAnimationPrototype = ComplexAnimation(0, framerate);
-               battleRes.numberAnimationPrototype.AddFrame(0, 0);
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -26));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -42));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -48));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -42));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -26));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0);
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -12));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -20));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -24));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -20));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -12));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0);
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -6));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -10));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -12));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -10));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -6));
-               battleRes.numberAnimationPrototype.AddFrames(0, 0, Vector<int>(), 14);
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -36));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -32));
-               battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -18));
+               ComplexAnimation numberAnimationPrototype(0, framerate);
+               numberAnimationPrototype.AddFrame(0, 0);
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -26));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -42));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -48));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -42));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -26));
+               numberAnimationPrototype.AddFrame(0, 0);
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -12));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -20));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -24));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -20));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -12));
+               numberAnimationPrototype.AddFrame(0, 0);
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -6));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -10));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -12));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -10));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -6));
+               numberAnimationPrototype.AddFrames(0, 0, Vector<int>(), 14);
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -36));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -32));
+               numberAnimationPrototype.AddFrame(0, 0, Vector<int>(0, -18));
+               battleRes.numberAnimationPrototype = &numberAnimationPrototype;
 
                SDL_Surface *bigNumbersImg(IMG_Load("test-data/big-numbers.png"));
                Sprite bigNumbersSprite(bigNumbersImg, 16, 32);
 
                SDL_Surface *bigNumbersImg(IMG_Load("test-data/big-numbers.png"));
                Sprite bigNumbersSprite(bigNumbersImg, 16, 32);