aboutsummaryrefslogtreecommitdiff
path: root/midend.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-07-10 10:17:13 +0000
committerSimon Tatham <anakin@pobox.com>2005-07-10 10:17:13 +0000
commit3d2c442bc42050af618706899314414248126476 (patch)
treecadfacf9b241b06145d08d5cd6100cc22ddcafad /midend.c
parent145301d0dc5b75a89620ffe88bc8a890699eef59 (diff)
downloadpuzzles-3d2c442bc42050af618706899314414248126476.zip
puzzles-3d2c442bc42050af618706899314414248126476.tar.gz
puzzles-3d2c442bc42050af618706899314414248126476.tar.bz2
puzzles-3d2c442bc42050af618706899314414248126476.tar.xz
game_timing_state() now has access to the game_ui. This means that
whether the timer is currently going is no longer solely dependent on the current game_state: it can be dependent on more persistent information stored in the game_ui. In particular, Mines now freezes the timer permanently once you complete a grid for the first time, so that you can then backtrack through your solution process without destroying the information about how long it took you the first time through. [originally from svn r6088]
Diffstat (limited to 'midend.c')
-rw-r--r--midend.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/midend.c b/midend.c
index b5ce237..909368c 100644
--- a/midend.c
+++ b/midend.c
@@ -237,7 +237,8 @@ void midend_set_params(midend_data *me, game_params *params)
static void midend_set_timer(midend_data *me)
{
me->timing = (me->ourgame->is_timed &&
- me->ourgame->timing_state(me->states[me->statepos-1].state));
+ me->ourgame->timing_state(me->states[me->statepos-1].state,
+ me->ui));
if (me->timing || me->flash_time || me->anim_time)
activate_timer(me->frontend);
else
@@ -311,10 +312,10 @@ void midend_new_game(midend_data *me)
me->drawstate = me->ourgame->new_drawstate(me->states[0].state);
midend_size_new_drawstate(me);
me->elapsed = 0.0F;
- midend_set_timer(me);
if (me->ui)
me->ourgame->free_ui(me->ui);
me->ui = me->ourgame->new_ui(me->states[0].state);
+ midend_set_timer(me);
me->pressed_mouse_button = 0;
}