X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=universe.cc;h=55e1a6dfdb21723d6efc747849acfe93cc0f12d1;hb=01b5ab3f0b75969230e0f9c41e55992b3d29edee;hp=92b7a1b702558bc806c3efa719daee6f1dd22626;hpb=8697ab57c9138aa2bb1657a971e4c2cc5e4a1606;p=universe.git diff --git a/universe.cc b/universe.cc index 92b7a1b..55e1a6d 100644 --- a/universe.cc +++ b/universe.cc @@ -7,8 +7,10 @@ #include "universe.h" Universe::Universe(int nb_max_polygons, - scalar_t width, scalar_t height) : _width(width), _height(height), - _nb_max_polygons(nb_max_polygons), _nb_polygons(0) { + scalar_t width, scalar_t height) : _width(width), + _height(height), + _nb_max_polygons(nb_max_polygons), + _nb_polygons(0) { _polygons = new Polygon *[_nb_max_polygons]; for(int n = 0; n < _nb_max_polygons; n++) _polygons[n] = 0; } @@ -145,21 +147,19 @@ void Universe::draw(SimpleWindow *window) { } #endif -#ifdef CAIRO_SUPPORT -void Universe::draw(cairo_t *context_resource) { +void Universe::draw(Canvas *canvas) { for(int n = 0; n < _nb_polygons; n++) { if(_polygons[n]) { - _polygons[n]->draw(context_resource); + _polygons[n]->draw(canvas); } } for(int n = 0; n < _nb_polygons; n++) { if(_polygons[n]) { - _polygons[n]->draw_contours(context_resource); + _polygons[n]->draw_contours(canvas); } } } -#endif void Universe::apply_collision_forces(scalar_t dt) { const int nb_axis = 2;