src/Player.cc
branchnew_graphics
changeset 417 c503e0c6a740
parent 412 721c60072091
child 423 947ab54de4b7
equal deleted inserted replaced
416:38cba347a3a9 417:c503e0c6a740
     9 #include <ClanLib/display.h>
     9 #include <ClanLib/display.h>
    10 #include <algorithm>
    10 #include <algorithm>
    11 #include <string>
    11 #include <string>
    12 #include <cassert>
    12 #include <cassert>
    13 
    13 
    14 
    14 #if GRAPHICS_ENABLED
    15 // player static state
    15 /*
       
    16  * Static draw-related state
       
    17  */
    16 bool Player::skin_loaded = false;
    18 bool Player::skin_loaded = false;
    17 CL_Surface Player::skin_surface;
    19 CL_Surface Player::skin_surface;
       
    20 
       
    21 #endif
    18 
    22 
    19 // XXX: give these better names and move elsewhere
    23 // XXX: give these better names and move elsewhere
    20 const int img_num_aim = 5;
    24 const int img_num_aim = 5;
    21 const int img_num_step = 4;
    25 const int img_num_step = 4;
    22 const int img_height = 20;
    26 const int img_height = 20;
   323 
   327 
   324 void Player::addKill () {
   328 void Player::addKill () {
   325     kills++;
   329     kills++;
   326 }
   330 }
   327 
   331 
       
   332 #if GRAPHICS_ENABLED
   328 void Player::draw (graphics::Display &display, PixelCoordinate camera) {
   333 void Player::draw (graphics::Display &display, PixelCoordinate camera) {
   329     CL_GraphicContext *gc = display.get_gc();
   334     CL_GraphicContext *gc = display.get_gc();
   330 
   335 
   331     if (!isAlive())
   336     if (!isAlive())
   332         return;
   337         return;
   397             weaponName,
   402             weaponName,
   398             display.get_gc()
   403             display.get_gc()
   399         );
   404         );
   400     }
   405     }
   401 }
   406 }
   402 
   407 #endif
       
   408