]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
moved more configuration to test.l2s
[l2e.git] / src / main.cpp
index e1969307c93ff83dff5c88adfda6f2066c1e0e2d..e657f57b7320366e55e2cef5cfbc407dae819262 100644 (file)
@@ -132,39 +132,18 @@ int main(int argc, char **argv) {
                battleRes.lastSmallHeroTagFrame = intp.GetFrame("lastSmallHeroTagFrame");
                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);
-               battleRes.healthGauge = &healthGauge;
-               Gauge manaGauge(gauges, 0, 32, 0, 0, 16, 6, 1, 6);
-               battleRes.manaGauge = &manaGauge;
-               Gauge ikariGauge(gauges, 0, 48, 0, 0, 16, 6, 1, 6);
-               battleRes.ikariGauge = &ikariGauge;
-
-               SDL_Surface *selectFrameImg(IMG_Load("test-data/select-frame.png"));
-               Frame selectFrame(selectFrameImg, 16, 16);
-               battleRes.selectFrame = &selectFrame;
-
-               SDL_Surface *normalFontImg(IMG_Load("test-data/normal-font.png"));
-               Sprite normalFontSprite(normalFontImg, 16, 16);
-               Font normalFont(&normalFontSprite, 0, -2);
-               battleRes.normalFont = &normalFont;
-
-               SDL_Surface *disabledFontImg(IMG_Load("test-data/disabled-font.png"));
-               Sprite disabledFontSprite(disabledFontImg, 16, 16);
-               Font disabledFont(&disabledFontSprite, 0, -2);
-               battleRes.disabledFont = &disabledFont;
-
-               SDL_Surface *handCursorImg(IMG_Load("test-data/cursor-hand.png"));
-               Sprite handCursorSprite(handCursorImg, 32, 32);
-               battleRes.menuCursor = &handCursorSprite;
-
-               SDL_Surface *targetingIconsImg(IMG_Load("test-data/targeting-icons.png"));
-               Sprite weaponTargetCursor(targetingIconsImg, 32, 32);
-               Sprite magicTargetCursor(targetingIconsImg, 32, 32, 0, 32);
-               Sprite itemTargetCursor(targetingIconsImg, 32, 32, 0, 64);
-               battleRes.weaponTargetCursor = &weaponTargetCursor;
-               battleRes.magicTargetCursor = &magicTargetCursor;
-               battleRes.itemTargetCursor = &itemTargetCursor;
+               battleRes.healthGauge = intp.GetGauge("healthGauge");
+               battleRes.manaGauge = intp.GetGauge("manaGauge");
+               battleRes.ikariGauge = intp.GetGauge("ikariGauge");
+
+               battleRes.selectFrame = intp.GetFrame("selectFrame");
+               battleRes.normalFont = intp.GetFont("normalFont");
+               battleRes.disabledFont = intp.GetFont("disabledFont");
+               battleRes.menuCursor = intp.GetSprite("handCursor");
+
+               battleRes.weaponTargetCursor = intp.GetSprite("weaponTargetCursor");
+               battleRes.magicTargetCursor = intp.GetSprite("magicTargetCursor");
+               battleRes.itemTargetCursor = intp.GetSprite("itemTargetCursor");
 
                Spell resetSpell;
                resetSpell.SetName("Reset");
@@ -210,7 +189,7 @@ int main(int argc, char **argv) {
                selan.AddSpell(&valorSpell);
 
                battleRes.spellMenuHeadline = "Please choose a spell.";
-               battleRes.spellMenuPrototype = Menu<const Spell *>(&normalFont, &disabledFont, &handCursorSprite, 9, 6, 8, 0, 2, 32, 2, ':');
+               battleRes.spellMenuPrototype = Menu<const Spell *>(intp.GetFont("normalFont"), intp.GetFont("disabledFont"), intp.GetSprite("handCursor"), 9, 6, 8, 0, 2, 32, 2, ':');
 
                SDL_Surface *itemIcons(IMG_Load("test-data/item-icons.png"));
                Sprite potionIcon(itemIcons, 16, 16);
@@ -279,7 +258,7 @@ int main(int argc, char **argv) {
                battleRes.inventory = &inventory;
 
                battleRes.itemMenuHeadline = "Please choose an item.";
-               battleRes.itemMenuPrototype = Menu<const common::Item *>(&normalFont, &disabledFont, &handCursorSprite, 15, 6, 8, 16, 1, 32, 2, ':');
+               battleRes.itemMenuPrototype = Menu<const common::Item *>(intp.GetFont("normalFont"), intp.GetFont("disabledFont"), intp.GetSprite("handCursor"), 15, 6, 8, 16, 1, 32, 2, ':');
 
                SDL_Surface *swordAttackImg(IMG_Load("test-data/attack-sword.png"));
                Sprite swordAttackSprite(swordAttackImg, 96, 96);
@@ -501,7 +480,7 @@ int main(int argc, char **argv) {
 
                battleRes.ikariMenuHeadline = "Please choose equipment.";
                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.ikariMenuPrototype = Menu<const Item *>(intp.GetFont("normalFont"), intp.GetFont("disabledFont"), intp.GetSprite("handCursor"), 12, 6, intp.GetFont("normalFont")->CharHeight() / 2, intp.GetFont("normalFont")->CharWidth(), 1, intp.GetFont("normalFont")->CharWidth() * 2, 0, ':', 12, intp.GetFont("normalFont")->CharWidth());
 
                battleRes.escapeText = "Escapes.";