mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
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]
This commit is contained in:
14
cube.c
14
cube.c
@ -950,7 +950,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)
|
||||
{
|
||||
int direction;
|
||||
int pkey[2], skey[2], dkey[2];
|
||||
@ -1309,7 +1318,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)
|
||||
{
|
||||
int i, j;
|
||||
struct bbox bb = find_bbox(&state->params);
|
||||
|
Reference in New Issue
Block a user