diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-05-30 16:15:34 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-05-30 16:15:34 +0000 |
| commit | 90560462c4842dccc0288eb408f15539acc0ab83 (patch) | |
| tree | d32e6a40e8f20409f2fe4709ff85607a217e9d1f /mines.c | |
| parent | 7ddaa1382f064466f158315198788daf33b05052 (diff) | |
| download | puzzles-90560462c4842dccc0288eb408f15539acc0ab83.zip puzzles-90560462c4842dccc0288eb408f15539acc0ab83.tar.gz puzzles-90560462c4842dccc0288eb408f15539acc0ab83.tar.bz2 puzzles-90560462c4842dccc0288eb408f15539acc0ab83.tar.xz | |
First cut at a game timer. Yet another backend function which
indicates whether a particular game state should have the timer
going (for Mines the initial indeterminate state does not have this
property, and neither does a dead or won state); a midend function
that optionally (on request from the game) prepends a timer to the
front of the status bar text; some complicated midend timing code.
It's not great. It's ugly; it's probably slightly inaccurate; it's
got no provision for anyone but the game author decreeing whether a
game is timed or not. But Mines can't be taken seriously without a
timer, so it's a start.
[originally from svn r5866]
Diffstat (limited to 'mines.c')
| -rw-r--r-- | mines.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -10,8 +10,6 @@ * That hook can talk to the game_ui and set the cheated flag, * and then make_move can avoid setting the `won' flag after that. * - * - timer - * * - question marks (arrgh, preferences?) * * - sensible parameter constraints @@ -2700,6 +2698,13 @@ static int game_wants_statusbar(void) return TRUE; } +static int game_timing_state(game_state *state) +{ + if (state->dead || state->won || !state->layout->mines) + return FALSE; + return TRUE; +} + #ifdef COMBINED #define thegame mines #endif @@ -2733,4 +2738,5 @@ const struct game thegame = { game_anim_length, game_flash_length, game_wants_statusbar, + TRUE, game_timing_state, }; |