src/Projectile.cc
branchnew_graphics
changeset 412 721c60072091
parent 408 e6cfc44266af
child 417 c503e0c6a740
equal deleted inserted replaced
411:106aaf6eadfe 412:721c60072091
     1 #include "Projectile.hh"
     1 #include "Projectile.hh"
     2 #include "Graphics.hh"
       
     3 #include "Timer.hh"
     2 #include "Timer.hh"
     4 
     3 
     5    
     4    
     6 Projectile::Projectile (Player *player, Vector position, Vector velocity, Weapon *weapon, bool visible) :
     5 Projectile::Projectile (Player *player, Vector position, Vector velocity, Weapon *weapon, bool visible) :
     7     PhysicsObject(player->state.world, weapon->getMass(), position, velocity, PROJECTILE, weapon->getBounce()),
     6     PhysicsObject(player->state.world, weapon->getMass(), position, velocity, PROJECTILE, weapon->getBounce()),
    73 
    72 
    74     // super
    73     // super
    75     PhysicsObject::tick(dt);
    74     PhysicsObject::tick(dt);
    76 }
    75 }
    77 
    76 
    78 void Projectile::draw(Graphics *g, PixelCoordinate camera) const {
    77 void Projectile::draw(graphics::Display &display, PixelCoordinate camera) const {
    79     CL_GraphicContext *gc = g->get_gc();
    78     CL_GraphicContext *gc = display.get_gc();
    80 
    79 
    81     if (visible) {
    80     if (visible) {
    82         PixelCoordinate pos = getCoordinate() - camera;
    81         PixelCoordinate pos = getCoordinate() - camera;
    83         // XXX: scale
    82         // XXX: scale
    84         PixelDimension radius = (unsigned int) weapon->getRadius();
    83         PixelDimension radius = (unsigned int) weapon->getRadius();