From: Daniel Karbach Date: Sun, 12 Aug 2012 16:57:17 +0000 (+0200) Subject: added big numbers + animation X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=187a0f2c37bd4c1e80c5c4351aaf80695508817f;p=l2e.git added big numbers + animation --- diff --git a/src/battle/Resources.h b/src/battle/Resources.h index 73b2a8f..5e68281 100644 --- a/src/battle/Resources.h +++ b/src/battle/Resources.h @@ -8,6 +8,7 @@ #ifndef BATTLE_RESOURCES_H_ #define BATTLE_RESOURCES_H_ +#include "../graphics/ComplexAnimation.h" #include "../graphics/Menu.h" #include @@ -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) diff --git a/src/main.cpp b/src/main.cpp index e5391a1..0fd129b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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(0, -26)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -42)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -48)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -42)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -26)); + battleRes.numberAnimationPrototype.AddFrame(0, 0); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -12)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -20)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -24)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -20)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -12)); + battleRes.numberAnimationPrototype.AddFrame(0, 0); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -6)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -10)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -12)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -10)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -6)); + battleRes.numberAnimationPrototype.AddFrames(0, 0, Vector(), 14); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -36)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(0, -32)); + battleRes.numberAnimationPrototype.AddFrame(0, 0, Vector(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 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 index 0000000..4900a85 Binary files /dev/null and b/test-data/big-numbers.png differ