diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-06-28 11:14:09 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-06-28 11:14:09 +0000 |
| commit | 89fdc09c29f1219a7660ad6d1839cc914a009c02 (patch) | |
| tree | c9e9e95e109aa01df1a0ca8d310467929cf3049b /flip.c | |
| parent | 6c9beb697bd61c7e8d0eac8b7fce54cde134d9c9 (diff) | |
| download | puzzles-89fdc09c29f1219a7660ad6d1839cc914a009c02.zip puzzles-89fdc09c29f1219a7660ad6d1839cc914a009c02.tar.gz puzzles-89fdc09c29f1219a7660ad6d1839cc914a009c02.tar.bz2 puzzles-89fdc09c29f1219a7660ad6d1839cc914a009c02.tar.xz | |
More serialisation changes: the game_aux_info structure has now been
retired, and replaced with a simple string. Most of the games which
use it simply encode the string in the same way that the Solve move
will also be encoded, i.e. solve_game() simply returns
dupstr(aux_info). Again, this is a better approach than writing
separate game_aux_info serialise/deserialise functions because doing
it this way is self-testing (the strings are created and parsed
during the course of any Solve operation at all).
[originally from svn r6029]
Diffstat (limited to 'flip.c')
| -rw-r--r-- | flip.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -347,7 +347,7 @@ static void addneighbours(tree234 *t, int w, int h, int cx, int cy, } static char *new_game_desc(game_params *params, random_state *rs, - game_aux_info **aux, int interactive) + char **aux, int interactive) { int w = params->w, h = params->h, wh = w * h; int i, j; @@ -595,11 +595,6 @@ static char *new_game_desc(game_params *params, random_state *rs, return ret; } -static void game_free_aux_info(game_aux_info *aux) -{ - assert(!"Shouldn't happen"); -} - static char *validate_desc(game_params *params, char *desc) { int w = params->w, h = params->h, wh = w * h; @@ -676,7 +671,7 @@ static void rowxor(unsigned char *row1, unsigned char *row2, int len) } static char *solve_game(game_state *state, game_state *currstate, - game_aux_info *aux, char **error) + char *aux, char **error) { int w = state->w, h = state->h, wh = w * h; unsigned char *equations, *solution, *shortest; @@ -1229,7 +1224,6 @@ const struct game thegame = { TRUE, game_configure, custom_params, validate_params, new_game_desc, - game_free_aux_info, validate_desc, new_game, dup_game, |