]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
moved some sprites to test.l2s
[l2e.git] / src / main.cpp
index 90f08d53bed888b629406ef15b248de497511e64..1c87e33ff95a3728cc006b0470591da0e1a45c72 100644 (file)
@@ -103,18 +103,10 @@ int main(int argc, char **argv) {
 
                battle::Resources battleRes;
 
-               SDL_Surface *swapCursorImg(IMG_Load("test-data/swap-cursor.png"));
-               Sprite swapCursorSprite(swapCursorImg, 32, 32);
-               battleRes.swapCursor = &swapCursorSprite;
-               SDL_Surface *attackIconsImg(IMG_Load("test-data/attack-type-icons.png"));
-               Sprite attackIconsSprite(attackIconsImg, 32, 32);
-               battleRes.attackIcons = &attackIconsSprite;
-               SDL_Surface *attackChoiceIconsImg(IMG_Load("test-data/attack-choice-icons.png"));
-               Sprite attackChoiceIconsSprite(attackChoiceIconsImg, 16, 16);
-               battleRes.attackChoiceIcons = &attackChoiceIconsSprite;
-               SDL_Surface *moveIconsImg(IMG_Load("test-data/move-icons.png"));
-               Sprite moveIconsSprite(moveIconsImg, 32, 32);
-               battleRes.moveIcons = &moveIconsSprite;
+               battleRes.swapCursor = intp.GetSprite("swapCursor");
+               battleRes.attackIcons = intp.GetSprite("attackIcons");
+               battleRes.attackChoiceIcons = intp.GetSprite("attackChoiceIcons");
+               battleRes.moveIcons = intp.GetSprite("moveIcons");
 
                SDL_Surface *titleFrameImg(IMG_Load("test-data/title-frame.png"));
                Frame titleFrame(titleFrameImg, 16, 16);
@@ -125,41 +117,11 @@ int main(int argc, char **argv) {
                Font largeFont(&largeFontSprite, 0, -2);
                battleRes.titleFont = &largeFont;
 
-               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);
-               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;
+               battleRes.numberAnimationPrototype = intp.GetAnimation("numberAnimationPrototype");
+               battleRes.bigNumberSprite = intp.GetSprite("bigNumbers");
+               battleRes.greenNumberSprite = intp.GetSprite("bigGreenNumbers");
+
+               battleRes.heroTagLabels = intp.GetSprite("heroTagLabels");
                battleRes.levelLabelCol = 0;
                battleRes.levelLabelRow = 0;
                battleRes.healthLabelCol = 0;