diff --git a/main.cc b/main.cc index a21d992..6822b2c 100644 --- a/main.cc +++ b/main.cc @@ -67,6 +67,7 @@ void game_init() { void game_destroy() { c_index_destroy(); balls_destroy(); + polygons_destroy(); } static guint animation_timeout_id = 0; diff --git a/polygons.cc b/polygons.cc index 6e66eec..4256c36 100644 --- a/polygons.cc +++ b/polygons.cc @@ -277,13 +277,17 @@ void polygon::draw(cairo_t* cr) const { draw_circle(cr, centroid, 1); // draw speed - (10 * delta * this->speed).draw(cr, centroid); + (delta * this->speed).draw(cr, centroid); } void polygons_draw(cairo_t* cr) { - draw_circle(cr, col.impact_point, 3); // tbd - col.n.draw(cr, col.impact_point); // tbd + // draw_circle(cr, col.impact_point, 3); // tbd + // col.n.draw(cr, col.impact_point); // tbd for (const polygon* p = polygons; p != polygons + n_polygons; ++p) p->draw(cr); } + +void polygons_destroy() { + delete[] (polygons); +} diff --git a/polygons.h b/polygons.h index 8ccb6ae..c09be75 100644 --- a/polygons.h +++ b/polygons.h @@ -114,5 +114,6 @@ extern uint n_polygons; extern void polygons_init_state(); extern void polygons_update_state(); extern void polygons_draw(cairo_t* cr); +extern void polygons_destroy(); #endif