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, 0, 0, 0));
41 PartyLayout monstersLayout;
42 monstersLayout.AddPosition(Point<Uint8>(50, 50));
43 monstersLayout.AddPosition(Point<Uint8>(100, 50));
44 monstersLayout.AddPosition(Point<Uint8>(150, 50));
45 monstersLayout.AddPosition(Point<Uint8>(200, 50));
46 SDL_Surface *white100(SDL_CreateRGBSurface(0, 100, 100, 32, 0xFF000000, 0xFF0000, 0xFF00, 0xFF));
47 SDL_FillRect(white100, 0, SDL_MapRGB(bg->format, 0xFF, 0xFF, 0xFF));
48 Sprite dummyMonsterSprite(white100, 100, 100);
50 monster.SetSprite(&dummyMonsterSprite);
54 InitScreen screen(width, height);
56 BattleState *battleState(new BattleState(bg, monstersLayout));
57 battleState->AddMonster(monster);
58 battleState->AddMonster(monster);
59 battleState->AddMonster(monster);
60 battleState->AddMonster(monster);
61 Application app(screen.Screen(), battleState);
65 } catch (exception &e) {
66 cerr << "exception in main(): " << e.what() << endl;