X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=8f92a357dacb74830cd0350cc15ec55149c09c17;hb=4a1816af30dcfe53181a25355bd51cc7b24a83f1;hp=780b8c27b70c85e004d77d45e0a1a3b6e8358971;hpb=5ef75aee810e5a687fae24e3f95886241e36efda;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index 780b8c2..8f92a35 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,10 @@ #include "app/Application.h" #include "battle/BattleState.h" +#include "battle/Monster.h" +#include "battle/PartyLayout.h" +#include "geometry/Point.h" +#include "graphics/Sprite.h" #include "sdl/InitScreen.h" #include "sdl/InitSDL.h" @@ -15,6 +19,10 @@ using app::Application; using battle::BattleState; +using battle::Monster; +using battle::PartyLayout; +using geometry::Point; +using graphics::Sprite; using sdl::InitScreen; using sdl::InitSDL; @@ -27,15 +35,36 @@ int main(int argc, char **argv) { const int width = 800; const int height = 480; - // temporary + // temporary test data SDL_Surface *bg(SDL_CreateRGBSurface(0, width, height, 32, 0xFF000000, 0xFF0000, 0xFF00, 0xFF)); - SDL_FillRect(bg, 0, SDL_MapRGB(bg->format, 0, 0, 0)); + SDL_FillRect(bg, 0, SDL_MapRGB(bg->format, 0xFF, 0xFF, 0xFF)); + SDL_Rect r; + r.x = 1; + r.y = 1; + r.w = width - 2; + r.h = height - 2; + SDL_FillRect(bg, &r, SDL_MapRGB(bg->format, 0, 0, 0)); + PartyLayout monstersLayout; + monstersLayout.AddPosition(Point(50, 100)); + monstersLayout.AddPosition(Point(100, 100)); + monstersLayout.AddPosition(Point(150, 100)); + monstersLayout.AddPosition(Point(200, 100)); + SDL_Surface *white100(SDL_CreateRGBSurface(0, 100, 100, 32, 0xFF000000, 0xFF0000, 0xFF00, 0xFF)); + SDL_FillRect(white100, 0, SDL_MapRGB(bg->format, 0xFF, 0xFF, 0xFF)); + Sprite dummyMonsterSprite(white100, 100, 100); + Monster monster; + monster.SetSprite(&dummyMonsterSprite); try { InitSDL sdl; InitScreen screen(width, height); - Application app(screen.Screen(), new BattleState(bg)); + BattleState *battleState(new BattleState(bg, monstersLayout)); + battleState->AddMonster(monster); + battleState->AddMonster(monster); + battleState->AddMonster(monster); + battleState->AddMonster(monster); + Application app(&screen, battleState); app.Run(); return 0;