Mercurial > MadButterfly
diff src/paint.h @ 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 | e444a8c01735 |
children |
line wrap: on
line diff
--- a/src/paint.h Fri Oct 03 10:22:08 2008 +0800 +++ b/src/paint.h Sun Oct 05 23:32:58 2008 +0800 @@ -8,9 +8,9 @@ typedef float co_comp_t; -extern paint_t *paint_color_new(redraw_man_t *rdman, - co_comp_t r, co_comp_t g, - co_comp_t b, co_comp_t a); +extern paint_t *rdman_paint_color_new(redraw_man_t *rdman, + co_comp_t r, co_comp_t g, + co_comp_t b, co_comp_t a); extern void paint_color_set(paint_t *paint, co_comp_t r, co_comp_t g, co_comp_t b, co_comp_t a); @@ -19,9 +19,11 @@ co_comp_t *b, co_comp_t *a); #define paint_init(_paint, _prepare, _free) \ do { \ + (_paint)->flags = 0; \ (_paint)->prepare = _prepare; \ (_paint)->free = _free; \ STAILQ_INIT((_paint)->members); \ + (_paint)->pnt_next = NULL; \ } while(0) \ @@ -30,13 +32,14 @@ co_comp_t r, g, b, a; } grad_stop_t; -extern paint_t *paint_linear_new(redraw_man_t *rdman, - co_aix x1, co_aix y1, co_aix x2, co_aix y2); +extern paint_t *rdman_paint_linear_new(redraw_man_t *rdman, + co_aix x1, co_aix y1, + co_aix x2, co_aix y2); extern grad_stop_t *paint_linear_stops(paint_t *paint, int n_stops, grad_stop_t *stops); -extern paint_t *paint_radial_new(redraw_man_t *rdman, - co_aix cx, co_aix cy, co_aix r); +extern paint_t *rdman_paint_radial_new(redraw_man_t *rdman, + co_aix cx, co_aix cy, co_aix r); extern grad_stop_t *paint_radial_stops(paint_t *paint, int n_stops, grad_stop_t *stops);