diff src/shape_rect.c @ 159:b90abd31a281

Postponse free of coords, shapes, and paints when the rdman is dirty. - Life-cycle of shapes and paints are managed by rdman. - Add redraw_man_t::free_objs to collect objects their freeing are postonsed. Know Issue: - Bullet of tank are not removed from screen when it is go out the range of the map.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 05 Oct 2008 23:32:58 +0800
parents 9ab15ebc9061
children c7e5b8779bb5
line wrap: on
line diff
--- a/src/shape_rect.c	Fri Oct 03 10:22:08 2008 +0800
+++ b/src/shape_rect.c	Sun Oct 05 23:32:58 2008 +0800
@@ -16,8 +16,9 @@
     free(shape);
 }
 
-shape_t *sh_rect_new(co_aix x, co_aix y, co_aix w, co_aix h,
-		    co_aix rx, co_aix ry) {
+shape_t *rdman_shape_rect_new(redraw_man_t *rdman,
+			      co_aix x, co_aix y, co_aix w, co_aix h,
+			      co_aix rx, co_aix ry) {
     sh_rect_t *rect;
 
     rect = (sh_rect_t *)malloc(sizeof(sh_rect_t));
@@ -35,6 +36,8 @@
     rect->ry = ry;
     rect->shape.free = sh_rect_free;
 
+    rdman_shape_man(rdman, (shape_t *)rect);
+
     return (shape_t *)rect;
 }