ref: 789e11f8f802889904c7eb137d354877f647c88d
parent: ccd579e72ee8ea2de46786a6b296f37a0ecf5867
author: Ben Harris <bjh21@bjh21.me.uk>
date: Tue Jan 31 16:05:47 EST 2023
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.
--- a/blackbox.c
+++ b/blackbox.c
@@ -468,16 +468,6 @@
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 @@
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 @@
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 @@
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 */
};
--- a/bridges.c
+++ b/bridges.c
@@ -3188,11 +3188,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
REQUIRE_RBUTTON, /* flags */
};
--- a/cube.c
+++ b/cube.c
@@ -1023,22 +1023,6 @@
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 @@
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 @@
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 @@
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 */
};
--- a/dominosa.c
+++ b/dominosa.c
@@ -3369,11 +3369,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/fifteen.c
+++ b/fifteen.c
@@ -1080,19 +1080,6 @@
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 @@
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 */
};
--- a/filling.c
+++ b/filling.c
@@ -2093,11 +2093,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
REQUIRE_NUMPAD, /* flags */
};
--- a/flip.c
+++ b/flip.c
@@ -1321,19 +1321,6 @@
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 @@
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 */
};
--- a/flood.c
+++ b/flood.c
@@ -1341,19 +1341,6 @@
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 @@
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 */
};
--- a/galaxies.c
+++ b/galaxies.c
@@ -3633,11 +3633,6 @@
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 @@
true, false, game_print_size, game_print,
false, /* wants_statusbar */
#endif
- false, game_timing_state,
+ false, NULL, /* timing_state */
REQUIRE_RBUTTON, /* flags */
};
--- a/guess.c
+++ b/guess.c
@@ -359,16 +359,6 @@
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 @@
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 @@
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 @@
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 */
};
--- a/inertia.c
+++ b/inertia.c
@@ -2205,19 +2205,6 @@
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 @@
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 */
};
--- a/keen.c
+++ b/keen.c
@@ -1490,16 +1490,6 @@
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 @@
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 @@
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 @@
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 */
};
--- a/lightup.c
+++ b/lightup.c
@@ -2255,11 +2255,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/loopy.c
+++ b/loopy.c
@@ -980,11 +980,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false /* wants_statusbar */,
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* mouse_priorities */
};
--- a/magnets.c
+++ b/magnets.c
@@ -2344,11 +2344,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
REQUIRE_RBUTTON, /* flags */
};
--- a/map.c
+++ b/map.c
@@ -2261,16 +2261,6 @@
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 @@
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 @@
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 @@
game_status,
true, true, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/mines.c
+++ b/mines.c
@@ -3215,14 +3215,6 @@
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 @@
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,
--- a/mosaic.c
+++ b/mosaic.c
@@ -1587,19 +1587,6 @@
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 @@
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 */
};
--- a/net.c
+++ b/net.c
@@ -1848,16 +1848,6 @@
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 @@
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 @@
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 @@
game_status,
true, false, game_print_size, game_print,
true, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/netslide.c
+++ b/netslide.c
@@ -893,16 +893,6 @@
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 @@
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 @@
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 @@
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 */
};
--- a/nullgame.c
+++ b/nullgame.c
@@ -68,16 +68,6 @@
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 @@
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 @@
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,7 +233,7 @@
encode_params,
free_params,
dup_params,
- false, game_configure, custom_params,
+ false, NULL, NULL, /* configure, custom_params */
validate_params,
new_game_desc,
validate_desc,
@@ -279,8 +240,8 @@
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 @@
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 */
};
--- a/palisade.c
+++ b/palisade.c
@@ -1303,12 +1303,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
true, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/pattern.c
+++ b/pattern.c
@@ -1994,11 +1994,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
REQUIRE_RBUTTON, /* flags */
};
--- a/pearl.c
+++ b/pearl.c
@@ -2599,11 +2599,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/pegs.c
+++ b/pegs.c
@@ -722,12 +722,6 @@
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 @@
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 @@
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 @@
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 */
};
--- a/range.c
+++ b/range.c
@@ -1768,12 +1768,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/rect.c
+++ b/rect.c
@@ -2912,11 +2912,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
true, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/samegame.c
+++ b/samegame.c
@@ -1016,12 +1016,6 @@
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 @@
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 @@
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 @@
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 */
};
--- a/signpost.c
+++ b/signpost.c
@@ -2227,11 +2227,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
REQUIRE_RBUTTON, /* flags */
};
--- a/singles.c
+++ b/singles.c
@@ -1788,11 +1788,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
REQUIRE_RBUTTON, /* flags */
};
--- a/sixteen.c
+++ b/sixteen.c
@@ -1175,19 +1175,6 @@
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 @@
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 */
};
--- a/slant.c
+++ b/slant.c
@@ -2090,11 +2090,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/solo.c
+++ b/solo.c
@@ -5336,13 +5336,6 @@
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 @@
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 */
};
--- a/tents.c
+++ b/tents.c
@@ -2583,11 +2583,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
REQUIRE_RBUTTON, /* flags */
};
--- a/towers.c
+++ b/towers.c
@@ -1960,13 +1960,6 @@
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 @@
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 */
};
--- a/tracks.c
+++ b/tracks.c
@@ -2979,11 +2979,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/twiddle.c
+++ b/twiddle.c
@@ -1287,19 +1287,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 twiddle
#endif
@@ -1339,9 +1326,9 @@
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 */
};
--- a/undead.c
+++ b/undead.c
@@ -2770,19 +2770,6 @@
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 @@
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 */
};
--- a/unequal.c
+++ b/unequal.c
@@ -2086,11 +2086,6 @@
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 @@
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 */
};
--- a/unruly.c
+++ b/unruly.c
@@ -1970,11 +1970,6 @@
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 @@
game_status,
true, false, game_print_size, game_print,
false, /* wants_statusbar */
- false, game_timing_state,
+ false, NULL, /* timing_state */
0, /* flags */
};
--- a/untangle.c
+++ b/untangle.c
@@ -1028,16 +1028,6 @@
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 @@
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 @@
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 @@
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 */
};