]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
made application and battle state resizable
[l2e.git] / src / main.cpp
index b2904b5c6c3edfee8467e3242b1515d3d65ee74d..8f92a357dacb74830cd0350cc15ec55149c09c17 100644 (file)
@@ -37,12 +37,18 @@ int main(int argc, char **argv) {
 
        // 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<Uint8>(50, 50));
-       monstersLayout.AddPosition(Point<Uint8>(100, 50));
-       monstersLayout.AddPosition(Point<Uint8>(150, 50));
-       monstersLayout.AddPosition(Point<Uint8>(200, 50));
+       monstersLayout.AddPosition(Point<Uint8>(50, 100));
+       monstersLayout.AddPosition(Point<Uint8>(100, 100));
+       monstersLayout.AddPosition(Point<Uint8>(150, 100));
+       monstersLayout.AddPosition(Point<Uint8>(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);
@@ -58,7 +64,7 @@ int main(int argc, char **argv) {
                battleState->AddMonster(monster);
                battleState->AddMonster(monster);
                battleState->AddMonster(monster);
-               Application app(screen.Screen(), battleState);
+               Application app(&screen, battleState);
                app.Run();
 
                return 0;