X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=4b4ca58f1f4475076d1b4d3186234b9247d53e72;hb=04b582180c8f86f50f08f5141a2514a1fcda3e01;hp=a2672503090bbc3d5cb8d889745bbdec29236bf2;hpb=41983a2cd8dbbfe6adc02cdfccbf5c2887306e51;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index a267250..4b4ca58 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -73,14 +73,15 @@ int main(int argc, char **argv) { monstersLayout.AddPosition(Point(168, 104)); monstersLayout.AddPosition(Point(208, 104)); PartyLayout heroesLayout; - heroesLayout.AddPosition(Point(27, 219)); - heroesLayout.AddPosition(Point(104, 227)); - heroesLayout.AddPosition(Point(66, 238)); - heroesLayout.AddPosition(Point(143, 246)); + heroesLayout.AddPosition(Point(48, 152)); + heroesLayout.AddPosition(Point(128, 152)); + heroesLayout.AddPosition(Point(80, 168)); + heroesLayout.AddPosition(Point(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(&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);