]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
added hero status tags in party menu
[l2e.git] / src / main.cpp
index cd3de2ac172e510d065523f4a17478081833e7cf..b06b5c7533b1e463460461bafe613af016acf743 100644 (file)
@@ -30,6 +30,7 @@
 #include "graphics/Menu.h"
 #include "graphics/SimpleAnimation.h"
 #include "graphics/Sprite.h"
+#include "graphics/Texture.h"
 #include "loader/Caster.h"
 #include "loader/Interpreter.h"
 #include "loader/ParsedSource.h"
@@ -41,6 +42,7 @@
 #include "map/MapState.h"
 #include "map/Tile.h"
 #include "map/Trigger.h"
+#include "menu/Resources.h"
 #include "sdl/InitImage.h"
 #include "sdl/InitScreen.h"
 #include "sdl/InitSDL.h"
@@ -62,32 +64,16 @@ using battle::Monster;
 using battle::PartyLayout;
 using common::GameConfig;
 using common::GameState;
-using common::Hero;
-using common::Ikari;
-using common::Inventory;
-using common::Item;
-using common::Script;
 using common::Spell;
-using common::Stats;
 using geometry::Vector;
-using graphics::ComplexAnimation;
-using graphics::Font;
-using graphics::Frame;
-using graphics::Gauge;
-using graphics::Menu;
-using graphics::SimpleAnimation;
-using graphics::Sprite;
+using graphics::Texture;
 using loader::Caster;
 using loader::Interpreter;
 using loader::ParsedSource;
 using loader::Parser;
 using loader::TypeDescription;
-using map::Area;
 using map::Entity;
-using map::Map;
 using map::MapState;
-using map::Tile;
-using map::Trigger;
 using sdl::InitImage;
 using sdl::InitScreen;
 using sdl::InitSDL;
@@ -113,28 +99,33 @@ int main(int argc, char **argv) {
                InitSDL sdl;
                InitImage image(IMG_INIT_PNG);
 
-               Area::CreateTypeDescription();
-               battle::Resources::CreateTypeDescription();
-               ComplexAnimation::CreateTypeDescription();
-               Font::CreateTypeDescription();
-               Frame::CreateTypeDescription();
-               Gauge::CreateTypeDescription();
-               Hero::CreateTypeDescription();
-               Ikari::CreateTypeDescription();
                Interpreter::CreateTypeDescriptions();
-               Item::CreateTypeDescription();
-               Map::CreateTypeDescription();
-               graphics::MenuProperties::CreateTypeDescription();
-               Monster::CreateTypeDescription();
-               PartyLayout::CreateTypeDescription();
-               SimpleAnimation::CreateTypeDescription();
-               Spell::CreateTypeDescription();
-               Sprite::CreateTypeDescription();
-               Stats::CreateTypeDescription();
+
+               battle::Resources::CreateTypeDescription();
+               battle::Monster::CreateTypeDescription();
+               battle::PartyLayout::CreateTypeDescription();
+
+               common::Hero::CreateTypeDescription();
+               common::Ikari::CreateTypeDescription();
+               common::Item::CreateTypeDescription();
+               common::Stats::CreateTypeDescription();
+               common::Spell::CreateTypeDescription();
                common::TargetingMode::CreateTypeDescription();
-               Tile::CreateTypeDescription();
-               Trigger::CreateTypeDescription();
-               Entity::CreateTypeDescription();
+
+               graphics::Animation::CreateTypeDescription();
+               graphics::ComplexAnimation::CreateTypeDescription();
+               graphics::Font::CreateTypeDescription();
+               graphics::Frame::CreateTypeDescription();
+               graphics::Gauge::CreateTypeDescription();
+               graphics::MenuProperties::CreateTypeDescription();
+               graphics::SimpleAnimation::CreateTypeDescription();
+               graphics::Sprite::CreateTypeDescription();
+
+               map::Area::CreateTypeDescription();
+               map::Entity::CreateTypeDescription();
+               map::Map::CreateTypeDescription();
+               map::Tile::CreateTypeDescription();
+               map::Trigger::CreateTypeDescription();
 
                Arguments args;
                args.Read(argc, argv);
@@ -189,12 +180,6 @@ int main(int argc, char **argv) {
 
                Caster caster(intp);
 
-               {
-                       Map *map1(caster.GetMap("map1"));
-                       Map *map2(caster.GetMap("map2"));
-                       std::cout << map1 << ' ' << map2 << std::endl;
-               }
-
                GameState gameState;
 
                gameState.heroes[0] = *caster.GetHero("maxim");
@@ -286,6 +271,19 @@ int main(int argc, char **argv) {
                gameState.heroes[3].MapEntity().SetFlags(Entity::FLAG_NONBLOCKING);
                gameState.heroes[2].MapEntity().AddFollower(&gameState.heroes[3].MapEntity());
 
+               menu::Resources menuResources;
+               gameConfig.menuResources = &menuResources;
+
+               Texture menubg;
+               menubg.SetSurface(IMG_Load("test-data/menubg.png"));
+               menubg.SetSize(Vector<int>(64, 64));
+               menuResources.menubg = &menubg;
+
+               menuResources.normalFont = gameConfig.battleResources->normalFont;
+
+               graphics::Sprite statusLabels(IMG_Load("test-data/status-labels.png"), 32, 16);
+               menuResources.statusLabels = &statusLabels;
+
                InitScreen screen(width, height);
 
                app::State *state(0);