Mercurial > MadButterfly
diff examples/tank/tank_main.c @ 160:147c93163ef0
Fix bug of tank that bullet is not hidden when go out the map.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 08 Oct 2008 03:57:56 +0800 |
parents | b90abd31a281 |
children | 530bb7728546 |
line wrap: on
line diff
--- a/examples/tank/tank_main.c Sun Oct 05 23:32:58 2008 +0800 +++ b/examples/tank/tank_main.c Wed Oct 08 03:57:56 2008 +0800 @@ -320,19 +320,9 @@ static void bullet_go_out_map_and_redraw(event_t *event, void *arg) { tank_t *tank = (tank_t *)arg; tank_bullet_t *bullet; -#if 0 - ob_factory_t *factory; - subject_t *redraw; -#endif bullet = tank->bullet; mb_progm_free(bullet->progm); - rdman_force_clean(bullet->rdman); -#if 0 - factory = rdman_get_ob_factory(bullet->rdman); - redraw = rdman_get_redraw_subject(bullet->rdman); - subject_remove_observer(factory, redraw, bullet->ob_redraw); -#endif tank_bullet_free(tank->bullet); tank->bullet = NULL; } @@ -341,10 +331,6 @@ tank_t *tank = (tank_t *)arg; tank_bullet_t *bullet; redraw_man_t *rdman; -#if 0 - subject_t *redraw; - ob_factory_t *factory; -#endif bullet = tank->bullet; rdman = bullet->rdman; @@ -356,13 +342,7 @@ rdman_coord_changed(rdman, bullet->coord_pos); /*! \todo Simplify the procdure of using observer pattern. */ -#if 0 - factory = rdman_get_ob_factory(rdman); - redraw = rdman_get_redraw_subject(rdman); - bullet->ob_redraw = - subject_add_observer(factory, redraw, - bullet_go_out_map_and_redraw, tank); -#endif + bullet_go_out_map_and_redraw(NULL, tank); }