src/Projectile.cc
changeset 311 440763821484
parent 309 05a39422c81e
child 338 fe2b3c6fff54
equal deleted inserted replaced
310:7e0cfc5f0944 311:440763821484
    78 void Projectile::draw(Graphics *g, PixelCoordinate camera) const {
    78 void Projectile::draw(Graphics *g, PixelCoordinate camera) const {
    79     CL_GraphicContext *gc = g->get_gc();
    79     CL_GraphicContext *gc = g->get_gc();
    80 
    80 
    81     if (visible) {
    81     if (visible) {
    82         PixelCoordinate pos = getCoordinate() - camera;
    82         PixelCoordinate pos = getCoordinate() - camera;
       
    83         // XXX: scale
    83         PixelDimension radius = (unsigned int) weapon->getRadius();
    84         PixelDimension radius = (unsigned int) weapon->getRadius();
    84 
    85 
    85         CL_Quad projectile(
    86         CL_Quad projectile(
    86                 pos.x,                      pos.y - weapon->getRadius(),
    87                 pos.x,              pos.y - radius,
    87                 pos.x + weapon->getRadius(), pos.y,
    88                 pos.x + radius,     pos.y,
    88                 pos.x,                      pos.y + weapon->getRadius(),
    89                 pos.x,              pos.y + radius,
    89                 pos.x - weapon->getRadius(),             pos.y
    90                 pos.x - radius,     pos.y
    90         );
    91         );
    91         
    92         
    92         gc->fill_quad(projectile, CL_Color::green);
    93         gc->fill_quad(projectile, CL_Color::green);
    93     }
    94     }
    94 }
    95 }