Added the destroy method for the polygons
This commit is contained in:
parent
00dad13b2f
commit
92e51a96be
1
main.cc
1
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;
|
||||
|
10
polygons.cc
10
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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user