equal
deleted
inserted
replaced
1 |
1 |
2 #include "GameState.hh" |
2 #include "GameState.hh" |
3 #include "Engine.hh" |
3 #include "Engine.hh" |
4 #include "Config.hh" |
4 #include "Config.hh" |
|
5 #include "Error.hh" |
5 |
6 |
6 GameState::GameState (Terrain &terrain) : |
7 GameState::GameState (Terrain &terrain) : |
7 world(Vector(0, MAP_GRAVITY), Vector(terrain.getWidth(), terrain.getHeight()), terrain), |
8 world(Vector(0, MAP_GRAVITY), Vector(terrain.getWidth(), terrain.getHeight()), terrain), |
8 terrain(terrain), |
9 terrain(terrain), |
9 local_player(NULL), event_handler(NULL) |
10 local_player(NULL), event_handler(NULL) |
47 player_list.remove(player); |
48 player_list.remove(player); |
48 |
49 |
49 if (event_handler) |
50 if (event_handler) |
50 event_handler->on_player_left(player); |
51 event_handler->on_player_left(player); |
51 } |
52 } |
52 |
53 |
|
54 #if GRAPHICS_ENABLED |
53 void GameState::draw (graphics::Display &display, PixelCoordinate camera, bool displayWeapon) { |
55 void GameState::draw (graphics::Display &display, PixelCoordinate camera, bool displayWeapon) { |
54 // Draw terrain |
56 // Draw terrain |
55 terrain.draw(display, camera); |
57 terrain.draw(display, camera); |
56 |
58 |
57 // Draw players |
59 // Draw players |
68 // Draw projectiles |
70 // Draw projectiles |
69 for (std::list<Projectile*>::iterator it = projectiles.begin(); it != projectiles.end(); it++) { |
71 for (std::list<Projectile*>::iterator it = projectiles.begin(); it != projectiles.end(); it++) { |
70 (*it)->draw(display, camera); |
72 (*it)->draw(display, camera); |
71 } |
73 } |
72 } |
74 } |
73 |
75 #endif |
|
76 |