diff options
Diffstat (limited to 'src/play.c')
-rw-r--r-- | src/play.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -238,8 +238,11 @@ unsigned play_ticks(play_t *play, play_ticks_t timer) } -/* reset ticks counter to begin counting from now */ -void play_ticks_reset(play_t *play, play_ticks_t timer) +/* reset ticks counter to begin counting from now + * always returns 0 for convenience/ergonomic reasons to use as + * a new post-reset ticks value. + */ +unsigned play_ticks_reset(play_t *play, play_ticks_t timer) { assert(play); assert(timer < PLAY_TICKS_CNT); @@ -247,6 +250,8 @@ void play_ticks_reset(play_t *play, play_ticks_t timer) ticks_active(play); play->tick_offsets[timer] = SDL_GetTicks(); + + return 0; } @@ -272,7 +277,7 @@ int play_ticks_elapsed(play_t *play, play_ticks_t timer, unsigned duration) assert(timer < PLAY_TICKS_CNT); if (play_ticks(play, timer) >= duration) { - play_ticks_reset(play, timer); + (void) play_ticks_reset(play, timer); return 1; } |