diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-01-31 21:05:47 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-01-31 23:25:05 +0000 |
| commit | 789e11f8f802889904c7eb137d354877f647c88d (patch) | |
| tree | 67b9e13a88fa00a0b78912a7a4a9d4816ff0b3dd | |
| parent | ccd579e72ee8ea2de46786a6b296f37a0ecf5867 (diff) | |
| download | puzzles-789e11f8f802889904c7eb137d354877f647c88d.zip puzzles-789e11f8f802889904c7eb137d354877f647c88d.tar.gz puzzles-789e11f8f802889904c7eb137d354877f647c88d.tar.bz2 puzzles-789e11f8f802889904c7eb137d354877f647c88d.tar.xz | |
Remove various unused game functions
If can_configure is false, then the game's configure() and
custom_params() functions will never be called. If can_solve is false,
solve() will never be called. If can_format_as_text_ever is false,
can_format_as_text_now() and text_format() will never be called. If
can_print is false, print_size() and print() will never be called. If
is_timed is false, timing_state() will never be called.
In each case, almost all puzzles provided a function nonetheless. I
think this is because in Puzzles' early history there was no "game"
structure, so the functions had to be present for linking to work. But
now that everything indirects through the "game" structure, unused
functions can be left unimplemented and the corresponding pointers set
to NULL.
So now where the flags mentioned above are false, the corresponding
functions are omitted and the function pointers in the "game" structures
are NULL.
| -rw-r--r-- | blackbox.c | 29 | ||||
| -rw-r--r-- | bridges.c | 7 | ||||
| -rw-r--r-- | cube.c | 37 | ||||
| -rw-r--r-- | dominosa.c | 7 | ||||
| -rw-r--r-- | fifteen.c | 17 | ||||
| -rw-r--r-- | filling.c | 7 | ||||
| -rw-r--r-- | flip.c | 17 | ||||
| -rw-r--r-- | flood.c | 17 | ||||
| -rw-r--r-- | galaxies.c | 7 | ||||
| -rw-r--r-- | guess.c | 29 | ||||
| -rw-r--r-- | inertia.c | 17 | ||||
| -rw-r--r-- | keen.c | 21 | ||||
| -rw-r--r-- | lightup.c | 7 | ||||
| -rw-r--r-- | loopy.c | 7 | ||||
| -rw-r--r-- | magnets.c | 7 | ||||
| -rw-r--r-- | map.c | 19 | ||||
| -rw-r--r-- | mines.c | 10 | ||||
| -rw-r--r-- | mosaic.c | 17 | ||||
| -rw-r--r-- | net.c | 19 | ||||
| -rw-r--r-- | netslide.c | 29 | ||||
| -rw-r--r-- | nullgame.c | 49 | ||||
| -rw-r--r-- | palisade.c | 8 | ||||
| -rw-r--r-- | pattern.c | 7 | ||||
| -rw-r--r-- | pearl.c | 7 | ||||
| -rw-r--r-- | pegs.c | 25 | ||||
| -rw-r--r-- | range.c | 8 | ||||
| -rw-r--r-- | rect.c | 7 | ||||
| -rw-r--r-- | samegame.c | 25 | ||||
| -rw-r--r-- | signpost.c | 7 | ||||
| -rw-r--r-- | singles.c | 7 | ||||
| -rw-r--r-- | sixteen.c | 17 | ||||
| -rw-r--r-- | slant.c | 7 | ||||
| -rw-r--r-- | solo.c | 9 | ||||
| -rw-r--r-- | tents.c | 7 | ||||
| -rw-r--r-- | towers.c | 9 | ||||
| -rw-r--r-- | tracks.c | 7 | ||||
| -rw-r--r-- | twiddle.c | 17 | ||||
| -rw-r--r-- | undead.c | 17 | ||||
| -rw-r--r-- | unequal.c | 7 | ||||
| -rw-r--r-- | unruly.c | 7 | ||||
| -rw-r--r-- | untangle.c | 29 |
41 files changed, 71 insertions, 539 deletions
@@ -468,16 +468,6 @@ static char *solve_game(const game_state *state, const game_state *currstate, return dupstr("S"); } -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - struct game_ui { int flash_laserno; int errors; @@ -1540,19 +1530,6 @@ static int game_status(const game_state *state) return 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame blackbox #endif @@ -1573,7 +1550,7 @@ const struct game thegame = { dup_game, free_game, true, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -1592,9 +1569,9 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON, /* flags */ }; @@ -3188,11 +3188,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -3297,7 +3292,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON, /* flags */ }; @@ -1023,22 +1023,6 @@ static void free_game(game_state *state) sfree(state); } -static char *solve_game(const game_state *state, const game_state *currstate, - const char *aux, const char **error) -{ - return NULL; -} - -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - static game_ui *new_ui(const game_state *state) { return NULL; @@ -1758,19 +1742,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame cube #endif @@ -1790,8 +1761,8 @@ const struct game thegame = { new_game, dup_game, free_game, - false, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, /* solve */ + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -1810,8 +1781,8 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -3369,11 +3369,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -3463,7 +3458,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1080,19 +1080,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame fifteen #endif @@ -1132,9 +1119,9 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -2093,11 +2093,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2198,7 +2193,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_NUMPAD, /* flags */ }; @@ -1321,19 +1321,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame flip #endif @@ -1373,8 +1360,8 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1341,19 +1341,6 @@ static float game_flash_length(const game_state *oldstate, return 0.0F; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame flood #endif @@ -1393,8 +1380,8 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -3633,11 +3633,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - #ifndef EDITOR static void game_print_size(const game_params *params, float *x, float *y) { @@ -3868,7 +3863,7 @@ const struct game thegame = { true, false, game_print_size, game_print, false, /* wants_statusbar */ #endif - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON, /* flags */ }; @@ -359,16 +359,6 @@ static char *solve_game(const game_state *state, const game_state *currstate, return dupstr("S"); } -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - static bool is_markable(const game_params *params, pegrow pegs) { int i, nset = 0, nrequired; @@ -1500,19 +1490,6 @@ static int game_status(const game_state *state) return state->solved; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame guess #endif @@ -1533,7 +1510,7 @@ const struct game thegame = { dup_game, free_game, true, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -1552,9 +1529,9 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -2205,19 +2205,6 @@ static int game_status(const game_state *state) return state->gems == 0 ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame inertia #endif @@ -2257,8 +2244,8 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1490,16 +1490,6 @@ static char *solve_game(const game_state *state, const game_state *currstate, return out; } -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - struct game_ui { /* * These are the coordinates of the currently highlighted @@ -2231,13 +2221,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - if (state->completed) - return false; - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2492,7 +2475,7 @@ const struct game thegame = { dup_game, free_game, true, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -2513,7 +2496,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ }; @@ -2255,11 +2255,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2363,7 +2358,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -980,11 +980,6 @@ static void game_free_drawstate(drawing *dr, game_drawstate *ds) sfree(ds); } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static float game_anim_length(const game_state *oldstate, const game_state *newstate, int dir, game_ui *ui) { @@ -3694,7 +3689,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false /* wants_statusbar */, - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* mouse_priorities */ }; @@ -2344,11 +2344,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2485,7 +2480,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON, /* flags */ }; @@ -2261,16 +2261,6 @@ static char *solve_game(const game_state *state, const game_state *currstate, return dupstr(aux); } -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - struct game_ui { /* * drag_colour: @@ -3097,11 +3087,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -3275,7 +3260,7 @@ const struct game thegame = { dup_game, free_game, true, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -3296,7 +3281,7 @@ const struct game thegame = { game_status, true, true, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -3215,14 +3215,6 @@ static bool game_timing_state(const game_state *state, game_ui *ui) return true; } -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame mines #endif @@ -3262,7 +3254,7 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ true, game_timing_state, BUTTON_BEATS(LEFT_BUTTON, RIGHT_BUTTON) | REQUIRE_RBUTTON, @@ -1587,19 +1587,6 @@ static int game_status(const game_state *state) return 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return state->not_completed_clues > 0; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame mosaic #endif @@ -1640,9 +1627,9 @@ const struct game thegame = { game_get_cursor_location, game_status, #ifndef NO_PRINTING - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ #endif true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1848,16 +1848,6 @@ static char *solve_game(const game_state *state, const game_state *currstate, return ret; } -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - /* ---------------------------------------------------------------------- * Utility routine. */ @@ -3102,11 +3092,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -3262,7 +3247,7 @@ const struct game thegame = { dup_game, free_game, true, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -3283,6 +3268,6 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -893,16 +893,6 @@ static char *solve_game(const game_state *state, const game_state *currstate, return dupstr(aux); } -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - /* ---------------------------------------------------------------------- * Utility routine. */ @@ -1852,19 +1842,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return false; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame netslide #endif @@ -1885,7 +1862,7 @@ const struct game thegame = { dup_game, free_game, true, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -1904,9 +1881,9 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -68,16 +68,6 @@ static char *encode_params(const game_params *params, bool full) return dupstr("FIXME"); } -static config_item *game_configure(const game_params *params) -{ - return NULL; -} - -static game_params *custom_params(const config_item *cfg) -{ - return NULL; -} - static const char *validate_params(const game_params *params, bool full) { return NULL; @@ -118,22 +108,6 @@ static void free_game(game_state *state) sfree(state); } -static char *solve_game(const game_state *state, const game_state *currstate, - const char *aux, const char **error) -{ - return NULL; -} - -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - static game_ui *new_ui(const game_state *state) { return NULL; @@ -247,19 +221,6 @@ static int game_status(const game_state *state) return 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame nullgame #endif @@ -272,15 +233,15 @@ const struct game thegame = { encode_params, free_params, dup_params, - false, game_configure, custom_params, + false, NULL, NULL, /* configure, custom_params */ validate_params, new_game_desc, validate_desc, new_game, dup_game, free_game, - false, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, /* solve */ + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -299,8 +260,8 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1303,12 +1303,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - assert (!"this shouldn't get called"); - return false; /* placate optimiser */ -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -1416,6 +1410,6 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1994,11 +1994,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2105,7 +2100,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON, /* flags */ }; @@ -2599,11 +2599,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2711,7 +2706,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -722,12 +722,6 @@ static void free_game(game_state *state) sfree(state); } -static char *solve_game(const game_state *state, const game_state *currstate, - const char *aux, const char **error) -{ - return NULL; -} - static bool game_can_format_as_text_now(const game_params *params) { return true; @@ -1327,19 +1321,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame pegs #endif @@ -1359,7 +1340,7 @@ const struct game thegame = { new_game, dup_game, free_game, - false, solve_game, + false, NULL, /* solve */ true, game_can_format_as_text_now, game_text_format, new_ui, free_ui, @@ -1379,9 +1360,9 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1768,12 +1768,6 @@ static void draw_cell(drawing *draw, game_drawstate *ds, int r, int c, draw_update(draw, x, y, ts + 1, ts + 1); } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - puts("warning: game_timing_state was called (this shouldn't happen)"); - return false; /* the (non-existing) timer should not be running */ -} - /* ---------------------------------------------------------------------- * User interface: print */ @@ -1852,6 +1846,6 @@ struct game const thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -2912,11 +2912,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -3023,7 +3018,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1016,12 +1016,6 @@ static void free_game(game_state *state) sfree(state); } -static char *solve_game(const game_state *state, const game_state *currstate, - const char *aux, const char **error) -{ - return NULL; -} - static bool game_can_format_as_text_now(const game_params *params) { return true; @@ -1656,19 +1650,6 @@ static int game_status(const game_state *state) return state->complete ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame samegame #endif @@ -1688,7 +1669,7 @@ const struct game thegame = { new_game, dup_game, free_game, - false, solve_game, + false, NULL, /* solve */ true, game_can_format_as_text_now, game_text_format, new_ui, free_ui, @@ -1708,8 +1689,8 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -2227,11 +2227,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2314,7 +2309,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON, /* flags */ }; @@ -1788,11 +1788,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -1880,7 +1875,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON, /* flags */ }; @@ -1175,19 +1175,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame sixteen #endif @@ -1227,9 +1214,9 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -2090,11 +2090,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2207,7 +2202,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -5336,13 +5336,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - if (state->completed) - return false; - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -5661,7 +5654,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ }; @@ -2583,11 +2583,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2659,7 +2654,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON, /* flags */ }; @@ -1960,13 +1960,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - if (state->completed) - return false; - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2085,7 +2078,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ }; @@ -2979,11 +2979,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -3073,7 +3068,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1287,19 +1287,6 @@ static void game_redraw(drawing *dr, game_drawstate *ds, } } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame twiddle #endif @@ -1339,9 +1326,9 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ true, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -2770,19 +2770,6 @@ static int game_status(const game_state *state) return state->solved; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame undead #endif @@ -2822,8 +2809,8 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -2086,11 +2086,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2180,7 +2175,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ REQUIRE_RBUTTON | REQUIRE_NUMPAD, /* flags */ }; @@ -1970,11 +1970,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - static void game_print_size(const game_params *params, float *x, float *y) { int pw, ph; @@ -2058,7 +2053,7 @@ const struct game thegame = { game_status, true, false, game_print_size, game_print, false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ 0, /* flags */ }; @@ -1028,16 +1028,6 @@ static char *solve_game(const game_state *state, const game_state *currstate, return ret; } -static bool game_can_format_as_text_now(const game_params *params) -{ - return true; -} - -static char *game_text_format(const game_state *state) -{ - return NULL; -} - struct game_ui { int dragpoint; /* point being dragged; -1 if none */ point newpoint; /* where it's been dragged to so far */ @@ -1446,19 +1436,6 @@ static int game_status(const game_state *state) return state->completed ? +1 : 0; } -static bool game_timing_state(const game_state *state, game_ui *ui) -{ - return true; -} - -static void game_print_size(const game_params *params, float *x, float *y) -{ -} - -static void game_print(drawing *dr, const game_state *state, int tilesize) -{ -} - #ifdef COMBINED #define thegame untangle #endif @@ -1479,7 +1456,7 @@ const struct game thegame = { dup_game, free_game, true, solve_game, - false, game_can_format_as_text_now, game_text_format, + false, NULL, NULL, /* can_format_as_text_now, text_format */ new_ui, free_ui, encode_ui, @@ -1498,8 +1475,8 @@ const struct game thegame = { game_flash_length, game_get_cursor_location, game_status, - false, false, game_print_size, game_print, + false, false, NULL, NULL, /* print_size, print */ false, /* wants_statusbar */ - false, game_timing_state, + false, NULL, /* timing_state */ SOLVE_ANIMATES, /* flags */ }; |