Remove strange punctuation.
[sgt/puzzles] / cube.c
diff --git a/cube.c b/cube.c
index 99d5bb1..60730c0 100644 (file)
--- a/cube.c
+++ b/cube.c
@@ -985,6 +985,11 @@ static char *solve_game(game_state *state, game_state *currstate,
     return NULL;
 }
 
+static int game_can_format_as_text_now(game_params *params)
+{
+    return TRUE;
+}
+
 static char *game_text_format(game_state *state)
 {
     return NULL;
@@ -1110,8 +1115,8 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
         int cx, cy;
         double angle;
 
-        cx = state->squares[state->current].x * GRID_SCALE + ds->ox;
-        cy = state->squares[state->current].y * GRID_SCALE + ds->oy;
+        cx = (int)(state->squares[state->current].x * GRID_SCALE) + ds->ox;
+        cy = (int)(state->squares[state->current].y * GRID_SCALE) + ds->oy;
 
         if (x == cx && y == cy)
             return NULL;               /* clicked in exact centre!  */
@@ -1471,12 +1476,12 @@ static void game_set_size(drawing *dr, game_drawstate *ds,
 {
     struct bbox bb = find_bbox(params);
 
-    ds->gridscale = tilesize;
+    ds->gridscale = (float)tilesize;
     ds->ox = (int)(-(bb.l - solids[params->solid]->border) * ds->gridscale);
     ds->oy = (int)(-(bb.u - solids[params->solid]->border) * ds->gridscale);
 }
 
-static float *game_colours(frontend *fe, game_state *state, int *ncolours)
+static float *game_colours(frontend *fe, int *ncolours)
 {
     float *ret = snewn(3 * NCOLOURS, float);
 
@@ -1498,7 +1503,8 @@ static game_drawstate *game_new_drawstate(drawing *dr, game_state *state)
 {
     struct game_drawstate *ds = snew(struct game_drawstate);
 
-    ds->ox = ds->oy = ds->gridscale = 0.0F;/* not decided yet */
+    ds->ox = ds->oy = 0;
+    ds->gridscale = 0.0F; /* not decided yet */
 
     return ds;
 }
@@ -1682,11 +1688,6 @@ static float game_flash_length(game_state *oldstate,
     return 0.0F;
 }
 
-static int game_wants_statusbar(void)
-{
-    return TRUE;
-}
-
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -1705,7 +1706,7 @@ static void game_print(drawing *dr, game_state *state, int tilesize)
 #endif
 
 const struct game thegame = {
-    "Cube", "games.cube",
+    "Cube", "games.cube", "cube",
     default_params,
     game_fetch_preset,
     decode_params,
@@ -1720,7 +1721,7 @@ const struct game thegame = {
     dup_game,
     free_game,
     FALSE, solve_game,
-    FALSE, game_text_format,
+    FALSE, game_can_format_as_text_now, game_text_format,
     new_ui,
     free_ui,
     encode_ui,
@@ -1736,7 +1737,7 @@ const struct game thegame = {
     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 */
 };