shithub: puzzles

Download patch

ref: eb2013efc0a6201d0e46de65c1a905b676d13d01
parent: 40fcf516f40e10f23f5a9f6760bfffae206b2e49
author: Simon Tatham <anakin@pobox.com>
date: Sat Oct 22 12:52:16 EDT 2005

Cleanup: it was absolutely stupid for game_wants_statusbar() to be a
function, since it took no parameters by which to vary its decision,
and in any case it's hard to imagine a game which only
_conditionally_ wants a status bar. Changed it into a boolean data
field in the backend structure.

[originally from svn r6417]

--- a/blackbox.c
+++ b/blackbox.c
@@ -1378,11 +1378,6 @@
         return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1432,7 +1427,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/bridges.c
+++ b/bridges.c
@@ -2552,11 +2552,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2666,7 +2661,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/cube.c
+++ b/cube.c
@@ -1682,11 +1682,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1736,7 +1731,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/dominosa.c
+++ b/dominosa.c
@@ -1682,11 +1682,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1776,7 +1771,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/fifteen.c
+++ b/fifteen.c
@@ -827,11 +827,6 @@
         return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -881,7 +876,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/flip.c
+++ b/flip.c
@@ -1248,11 +1248,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1302,7 +1297,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/guess.c
+++ b/guess.c
@@ -1258,11 +1258,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1312,7 +1307,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/inertia.c
+++ b/inertia.c
@@ -2122,11 +2122,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2176,7 +2171,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/lightup.c
+++ b/lightup.c
@@ -2144,11 +2144,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2252,7 +2247,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/loopy.c
+++ b/loopy.c
@@ -2640,11 +2640,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2751,7 +2746,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/map.c
+++ b/map.c
@@ -2923,11 +2923,6 @@
 	return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -3121,7 +3116,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, TRUE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/midend.c
+++ b/midend.c
@@ -891,7 +891,7 @@
 
 int midend_wants_statusbar(midend *me)
 {
-    return me->ourgame->wants_statusbar();
+    return me->ourgame->wants_statusbar;
 }
 
 void midend_supersede_game_desc(midend *me, char *desc, char *privdesc)
--- a/mines.c
+++ b/mines.c
@@ -3023,11 +3023,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     if (state->dead || state->won || ui->completed || !state->layout->mines)
@@ -3079,7 +3074,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     TRUE, game_timing_state,
     BUTTON_BEATS(LEFT_BUTTON, RIGHT_BUTTON),
 };
--- a/net.c
+++ b/net.c
@@ -2690,11 +2690,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2871,7 +2866,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/netslide.c
+++ b/netslide.c
@@ -1771,11 +1771,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return FALSE;
@@ -1825,7 +1820,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/nullgame.c
+++ b/nullgame.c
@@ -233,11 +233,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -287,7 +282,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/pattern.c
+++ b/pattern.c
@@ -1169,11 +1169,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1279,7 +1274,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/pegs.c
+++ b/pegs.c
@@ -1168,11 +1168,6 @@
         return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1222,7 +1217,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/puzzles.h
+++ b/puzzles.h
@@ -396,7 +396,7 @@
     int can_print, can_print_in_colour;
     void (*print_size)(game_params *params, float *x, float *y);
     void (*print)(drawing *dr, game_state *state, int tilesize);
-    int (*wants_statusbar)(void);
+    int wants_statusbar;
     int is_timed;
     int (*timing_state)(game_state *state, game_ui *ui);
     int flags;
--- a/rect.c
+++ b/rect.c
@@ -2761,11 +2761,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2872,7 +2867,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/samegame.c
+++ b/samegame.c
@@ -1608,11 +1608,6 @@
 	return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1662,7 +1657,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/sixteen.c
+++ b/sixteen.c
@@ -1003,11 +1003,6 @@
         return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1057,7 +1052,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/slant.c
+++ b/slant.c
@@ -1970,11 +1970,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2087,7 +2082,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/solo.c
+++ b/solo.c
@@ -2980,11 +2980,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -3088,7 +3083,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/tents.c
+++ b/tents.c
@@ -2013,11 +2013,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2089,7 +2084,7 @@
     game_anim_length,
     game_flash_length,
     TRUE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/twiddle.c
+++ b/twiddle.c
@@ -1170,11 +1170,6 @@
     }
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1224,7 +1219,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    TRUE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     0,				       /* flags */
 };
--- a/untangle.c
+++ b/untangle.c
@@ -1407,11 +1407,6 @@
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return FALSE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1461,7 +1456,7 @@
     game_anim_length,
     game_flash_length,
     FALSE, FALSE, game_print_size, game_print,
-    game_wants_statusbar,
+    FALSE,			       /* wants_statusbar */
     FALSE, game_timing_state,
     SOLVE_ANIMATES,		       /* flags */
 };