diff src/shape_text.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 98c83441d7d6
children c7e5b8779bb5
line wrap: on
line diff
--- a/src/shape_text.c	Fri Oct 03 10:22:08 2008 +0800
+++ b/src/shape_text.c	Sun Oct 05 23:32:58 2008 +0800
@@ -32,8 +32,9 @@
     cairo_font_face_destroy(text->face);
 }
 
-shape_t *sh_text_new(const char *txt, co_aix x, co_aix y,
-		     co_aix font_size, cairo_font_face_t *face) {
+shape_t *rdman_shape_text_new(redraw_man_t *rdman,
+			      const char *txt, co_aix x, co_aix y,
+			      co_aix font_size, cairo_font_face_t *face) {
     sh_text_t *text;
 
     text = (sh_text_t *)malloc(sizeof(sh_text_t));
@@ -56,6 +57,8 @@
 
     text->shape.free = sh_text_free;
 
+    rdman_shape_man(rdman, (shape_t *)text);
+
     return (shape_t *)text;
 }