4 * Created on: Aug 1, 2012
8 #include "app/Application.h"
9 #include "battle/BattleState.h"
10 #include "battle/Monster.h"
11 #include "battle/PartyLayout.h"
12 #include "geometry/Point.h"
13 #include "graphics/Sprite.h"
14 #include "sdl/InitScreen.h"
15 #include "sdl/InitSDL.h"
20 using app::Application;
21 using battle::BattleState;
22 using battle::Monster;
23 using battle::PartyLayout;
24 using geometry::Point;
25 using graphics::Sprite;
26 using sdl::InitScreen;
34 int main(int argc, char **argv) {
35 const int width = 800;
36 const int height = 480;
38 // temporary test data
39 SDL_Surface *bg(SDL_CreateRGBSurface(0, width, height, 32, 0xFF000000, 0xFF0000, 0xFF00, 0xFF));
40 SDL_FillRect(bg, 0, SDL_MapRGB(bg->format, 0xFF, 0xFF, 0xFF));
46 SDL_FillRect(bg, &r, SDL_MapRGB(bg->format, 0, 0, 0));
47 PartyLayout monstersLayout;
48 monstersLayout.AddPosition(Point<Uint8>(50, 100));
49 monstersLayout.AddPosition(Point<Uint8>(100, 100));
50 monstersLayout.AddPosition(Point<Uint8>(150, 100));
51 monstersLayout.AddPosition(Point<Uint8>(200, 100));
52 SDL_Surface *white100(SDL_CreateRGBSurface(0, 100, 100, 32, 0xFF000000, 0xFF0000, 0xFF00, 0xFF));
53 SDL_FillRect(white100, 0, SDL_MapRGB(bg->format, 0xFF, 0xFF, 0xFF));
54 Sprite dummyMonsterSprite(white100, 100, 100);
56 monster.SetSprite(&dummyMonsterSprite);
60 InitScreen screen(width, height);
62 BattleState *battleState(new BattleState(bg, monstersLayout));
63 battleState->AddMonster(monster);
64 battleState->AddMonster(monster);
65 battleState->AddMonster(monster);
66 battleState->AddMonster(monster);
67 Application app(screen.Screen(), battleState);
71 } catch (exception &e) {
72 cerr << "exception in main(): " << e.what() << endl;