From 90560462c4842dccc0288eb408f15539acc0ab83 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 30 May 2005 16:15:34 +0000 Subject: 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] --- puzzles.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'puzzles.h') diff --git a/puzzles.h b/puzzles.h index 9eb991a..f3db36f 100644 --- a/puzzles.h +++ b/puzzles.h @@ -145,6 +145,7 @@ char *midend_game_id(midend_data *me, char *id); char *midend_text_format(midend_data *me); char *midend_solve(midend_data *me); void midend_supersede_game_desc(midend_data *me, char *desc); +char *midend_rewrite_statusbar(midend_data *me, char *text); /* * malloc.c @@ -239,6 +240,8 @@ struct game { float (*flash_length)(game_state *oldstate, game_state *newstate, int dir, game_ui *ui); int (*wants_statusbar)(void); + int is_timed; + int (*timing_state)(game_state *state); }; /* -- cgit v1.1