aboutsummaryrefslogtreecommitdiff
path: root/nullgame.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-05-11 17:44:30 +0000
committerSimon Tatham <anakin@pobox.com>2004-05-11 17:44:30 +0000
commit180802b362c715dfb22893021f3434834447e5b5 (patch)
treea19141061c1ce27e17dbb3dda20eaf4cfbbf2cb6 /nullgame.c
parenta1c88470a30cf57226aa091f546da18d0dff07e1 (diff)
downloadpuzzles-180802b362c715dfb22893021f3434834447e5b5.zip
puzzles-180802b362c715dfb22893021f3434834447e5b5.tar.gz
puzzles-180802b362c715dfb22893021f3434834447e5b5.tar.bz2
puzzles-180802b362c715dfb22893021f3434834447e5b5.tar.xz
Framework alteration: we now support a `game_ui' structure in
addition to the `game_state'. The new structure is intended to contain ephemeral data pertaining to the game's user interface rather than the actual game: things stored in the UI structure are not restored in an Undo, for example. make_move() is passed the UI to modify as it wishes; it is now allowed to return the _same_ game_state it was passed, to indicate that although no move has been made there has been a UI operation requiring a redraw. [originally from svn r4207]
Diffstat (limited to 'nullgame.c')
-rw-r--r--nullgame.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/nullgame.c b/nullgame.c
index 8df09e9..b4b94fe 100644
--- a/nullgame.c
+++ b/nullgame.c
@@ -109,7 +109,16 @@ void free_game(game_state *state)
sfree(state);
}
-game_state *make_move(game_state *from, int x, int y, int button)
+game_ui *new_ui(game_state *state)
+{
+ return NULL;
+}
+
+void free_ui(game_ui *ui)
+{
+}
+
+game_state *make_move(game_state *from, game_ui *ui, int x, int y, int button)
{
return NULL;
}
@@ -152,7 +161,8 @@ void game_free_drawstate(game_drawstate *ds)
}
void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
- game_state *state, float animtime, float flashtime)
+ game_state *state, game_ui *ui,
+ float animtime, float flashtime)
{
}