]> git.localhorst.tv Git - l2e.git/commitdiff
added big numbers + animation
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 12 Aug 2012 16:57:17 +0000 (18:57 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 12 Aug 2012 16:57:17 +0000 (18:57 +0200)
src/battle/Resources.h
src/main.cpp
test-data/big-green-numbers.png [new file with mode: 0644]
test-data/big-numbers.png [new file with mode: 0644]

index 73b2a8f15f3a801c387925b9ce3b4bc583dd7359..5e68281548b4e1bc8cef7b9de7d01bb22a7cc62b 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef BATTLE_RESOURCES_H_
 #define BATTLE_RESOURCES_H_
 
+#include "../graphics/ComplexAnimation.h"
 #include "../graphics/Menu.h"
 
 #include <SDL.h>
@@ -71,6 +72,11 @@ struct Resources {
 
        const char *escapeText;
 
+       graphics::ComplexAnimation numberAnimationPrototype;
+
+       const graphics::Sprite *bigNumberSprite;
+       const graphics::Sprite *greenNumberSprite;
+
        graphics::Sprite *weaponMenuIcon;
        graphics::Sprite *armorMenuIcon;
        graphics::Sprite *shieldMenuIcon;
@@ -131,6 +137,9 @@ struct Resources {
 
        , escapeText("")
 
+       , bigNumberSprite(0)
+       , greenNumberSprite(0)
+
        , weaponMenuIcon(0)
        , armorMenuIcon(0)
        , shieldMenuIcon(0)
index e5391a1659f50a19184c0cc36cff72c6020ab9e4..0fd129b98618401a1acc34f5f419ba448ba2d5cc 100644 (file)
@@ -221,6 +221,37 @@ int main(int argc, char **argv) {
                Font largeFont(&largeFontSprite, 0, -2);
                battleRes.titleFont = &largeFont;
 
+               battleRes.numberAnimationPrototype = ComplexAnimation(0, 30);
+               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));
+
+               SDL_Surface *bigNumbersImg(IMG_Load("test-data/big-numbers.png"));
+               Sprite bigNumbersSprite(bigNumbersImg, 16, 32);
+               battleRes.bigNumberSprite = &bigNumbersSprite;
+               SDL_Surface *bigGreenNumbersImg(IMG_Load("test-data/big-green-numbers.png"));
+               Sprite bigGreenNumbersSprite(bigGreenNumbersImg, 16, 32);
+               battleRes.greenNumberSprite = &bigGreenNumbersSprite;
+
                SDL_Surface *heroTagImg(IMG_Load("test-data/hero-tag-sprites.png"));
                Sprite heroTagSprite(heroTagImg, 32, 16);
                battleRes.heroTagLabels = &heroTagSprite;
diff --git a/test-data/big-green-numbers.png b/test-data/big-green-numbers.png
new file mode 100644 (file)
index 0000000..52cb2da
Binary files /dev/null and b/test-data/big-green-numbers.png differ
diff --git a/test-data/big-numbers.png b/test-data/big-numbers.png
new file mode 100644 (file)
index 0000000..4900a85
Binary files /dev/null and b/test-data/big-numbers.png differ