src/GameState.cc
branchnew_graphics
changeset 412 721c60072091
parent 408 e6cfc44266af
child 417 c503e0c6a740
equal deleted inserted replaced
411:106aaf6eadfe 412:721c60072091
    48     
    48     
    49     if (event_handler)
    49     if (event_handler)
    50         event_handler->on_player_left(player);
    50         event_handler->on_player_left(player);
    51 }
    51 }
    52     
    52     
    53 void GameState::draw(Graphics *g, PixelCoordinate camera, bool displayWeapon) {
    53 void GameState::draw (graphics::Display &display, PixelCoordinate camera, bool displayWeapon) {
    54     // Draw terrain
    54     // Draw terrain
    55     terrain.draw(g, camera);
    55     terrain.draw(display, camera);
    56 
    56 
    57     // Draw players
    57     // Draw players
    58     for (std::list<Player*>::iterator it = player_list.begin(); it != player_list.end(); it++) {
    58     for (std::list<Player*>::iterator it = player_list.begin(); it != player_list.end(); it++) {
    59         Player *p = *it;
    59         Player *p = *it;
    60         
    60         
    61         // our LocalPlayer has it's own draw method
    61         // our LocalPlayer has it's own draw method
    62         if (p == local_player)
    62         if (p == local_player)
    63             local_player->draw(g, displayWeapon, camera);
    63             local_player->draw(display, displayWeapon, camera);
    64         else
    64         else
    65             p->draw(g, camera);
    65             p->draw(display, camera);
    66     }
    66     }
    67 
    67 
    68     // Draw projectiles
    68     // Draw projectiles
    69     for (std::list<Projectile*>::iterator it = projectiles.begin(); it != projectiles.end(); it++) {
    69     for (std::list<Projectile*>::iterator it = projectiles.begin(); it != projectiles.end(); it++) {
    70         (*it)->draw(g, camera);
    70         (*it)->draw(display, camera);
    71     }
    71     }
    72 }
    72 }
    73  
    73