diff options
Diffstat (limited to 'src/game.c')
-rw-r--r-- | src/game.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -39,9 +39,19 @@ game_update(Game *this) } for (__auto_type i = 0; i < MAX_ENTITIES; i++) { const __auto_type e = &this->entities[i]; + if (e->type != 0 && e->update_begin != NULL) + e->update_begin(e, this); + } + for (__auto_type i = 0; i < MAX_ENTITIES; i++) { + const __auto_type e = &this->entities[i]; if (e->type != 0 && e->update != NULL) e->update(e, this); } + for (__auto_type i = 0; i < MAX_ENTITIES; i++) { + const __auto_type e = &this->entities[i]; + if (e->type != 0 && e->update_end != NULL) + e->update_end(e, this); + } } void @@ -50,9 +60,19 @@ game_draw(Game *this) map_draw(); for (int i = 0; i < MAX_ENTITIES; i++) { const __auto_type e = &this->entities[i]; + if (e->type != 0 && e->draw_begin != NULL) + e->draw_begin(e, this); + } + for (int i = 0; i < MAX_ENTITIES; i++) { + const __auto_type e = &this->entities[i]; if (e->type != 0 && e->draw != NULL) e->draw(e, this); } + for (int i = 0; i < MAX_ENTITIES; i++) { + const __auto_type e = &this->entities[i]; + if (e->type != 0 && e->draw_end != NULL) + e->draw_end(e, this); + } } void |