]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
added small hero tags (used in battle animation and run state)
[l2e.git] / src / main.cpp
index a2672503090bbc3d5cb8d889745bbdec29236bf2..4b4ca58f1f4475076d1b4d3186234b9247d53e72 100644 (file)
@@ -73,14 +73,15 @@ int main(int argc, char **argv) {
                monstersLayout.AddPosition(Point<Uint8>(168, 104));
                monstersLayout.AddPosition(Point<Uint8>(208, 104));
                PartyLayout heroesLayout;
-               heroesLayout.AddPosition(Point<Uint8>(27, 219));
-               heroesLayout.AddPosition(Point<Uint8>(104, 227));
-               heroesLayout.AddPosition(Point<Uint8>(66, 238));
-               heroesLayout.AddPosition(Point<Uint8>(143, 246));
+               heroesLayout.AddPosition(Point<Uint8>(48, 152));
+               heroesLayout.AddPosition(Point<Uint8>(128, 152));
+               heroesLayout.AddPosition(Point<Uint8>(80, 168));
+               heroesLayout.AddPosition(Point<Uint8>(160, 168));
 
                SDL_Surface *monsterImg(IMG_Load("test-data/monster.png"));
                Sprite dummySprite(monsterImg, 64, 64);
                Monster monster;
+               monster.SetName("Monster");
                monster.SetSprite(&dummySprite);
                monster.SetMaxHealth(10);
                monster.SetHealth(10);
@@ -135,6 +136,9 @@ 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;
@@ -144,9 +148,38 @@ int main(int argc, char **argv) {
                SDL_Surface *moveIconsImg(IMG_Load("test-data/move-icons.png"));
                Sprite moveIconsSprite(moveIconsImg, 32, 32);
                battleRes.moveIcons = &moveIconsSprite;
+
+               SDL_Surface *titleFrameImg(IMG_Load("test-data/title-frame.png"));
+               Frame titleFrame(titleFrameImg, 16, 16);
+               battleRes.titleFrame = &titleFrame;
+
+               SDL_Surface *largeFontImg(IMG_Load("test-data/large-font.png"));
+               Sprite largeFontSprite(largeFontImg, 16, 32);
+               Font largeFont(&largeFontSprite);
+               largeFont.MapRange('A', 'M', 0, 1);
+               largeFont.MapRange('N', 'Z', 0, 2);
+               largeFont.MapRange('a', 'm', 0, 3);
+               largeFont.MapRange('n', 'z', 0, 4);
+               largeFont.MapChar(':', 10, 0);
+               largeFont.MapChar('!', 11, 0);
+               largeFont.MapChar('?', 12, 0);
+               // TODO: add '.' and '-' characters
+               battleRes.titleFont = &largeFont;
+
                SDL_Surface *heroTagImg(IMG_Load("test-data/hero-tag-sprites.png"));
                Sprite heroTagSprite(heroTagImg, 32, 16);
                battleRes.heroTagLabels = &heroTagSprite;
+               battleRes.levelLabelCol = 0;
+               battleRes.levelLabelRow = 0;
+               battleRes.healthLabelCol = 0;
+               battleRes.healthLabelRow = 1;
+               battleRes.manaLabelCol = 0;
+               battleRes.manaLabelRow = 2;
+               battleRes.moveLabelCol = 0;
+               battleRes.moveLabelRow = 3;
+               battleRes.ikariLabelCol = 0;
+               battleRes.ikariLabelRow = 4;
+
                SDL_Surface *numbersImg(IMG_Load("test-data/numbers.png"));
                Sprite numbersSprite(numbersImg, 16, 16);
                Font heroTagFont(&numbersSprite);
@@ -156,6 +189,12 @@ int main(int argc, char **argv) {
                battleRes.heroTagFrame = &heroTagFrame;
                Frame activeHeroTagFrame(tagFramesImg, 16, 16);
                battleRes.activeHeroTagFrame = &activeHeroTagFrame;
+               SDL_Surface *smallTagFrameImg(IMG_Load("test-data/small-tag-frame.png"));
+               Frame smallTagFrame(smallTagFrameImg, 8, 16);
+               battleRes.smallHeroTagFrame = &smallTagFrame;
+               Frame lastSmallTagFrame(smallTagFrameImg, 8, 16, 1, 1, 0, 33);
+               battleRes.lastSmallHeroTagFrame = &lastSmallTagFrame;
+               battleRes.heroesBgColor = SDL_MapRGB(screen.Screen()->format, 0x18, 0x28, 0x31);
 
                SDL_Surface *gauges(IMG_Load("test-data/gauges.png"));
                Gauge healthGauge(gauges, 0, 16, 0, 0, 16, 6, 1, 6);
@@ -537,6 +576,8 @@ int main(int argc, char **argv) {
                battleRes.noEquipmentText = "No equip";
                battleRes.ikariMenuPrototype = Menu<const Item *>(&normalFont, &disabledFont, &handCursorSprite, 12, 6, normalFont.CharHeight() / 2, normalFont.CharWidth(), 1, normalFont.CharWidth() * 2, 0, ':', 12, normalFont.CharWidth());
 
+               battleRes.escapeText = "Escapes.";
+
                BattleState *battleState(new BattleState(bg, monstersLayout, heroesLayout, &battleRes));
                battleState->AddMonster(monster);
                battleState->AddMonster(monster);