game_params *ret = snew(game_params);
ret->w = 10;
+#ifdef PORTRAIT_SCREEN
+ ret->h = 10;
+#else
ret->h = 8;
-
+#endif
return ret;
}
}
static const struct game_params inertia_presets[] = {
+#ifdef PORTRAIT_SCREEN
+ { 10, 10 },
+ { 12, 12 },
+ { 16, 16 },
+#else
{ 10, 8 },
{ 15, 12 },
{ 20, 16 },
+#endif
};
static int game_fetch_preset(int i, char **name, game_params **params)
char *err, *soln, *p;
/*
+ * Before anything else, deal with the special case in which
+ * all the gems are already collected.
+ */
+ for (i = 0; i < wh; i++)
+ if (currstate->grid[i] == GEM)
+ break;
+ if (i == wh) {
+ *error = "Game is already solved";
+ return NULL;
+ }
+
+ /*
* Solving Inertia is a question of first building up the graph
* of where you can get to from where, and secondly finding a
* tour of the graph which takes in every gem.
#define PREFERRED_TILESIZE 32
#define TILESIZE (ds->tilesize)
+#ifdef SMALL_SCREEN
+#define BORDER (TILESIZE / 4)
+#else
#define BORDER (TILESIZE)
+#endif
#define HIGHLIGHT_WIDTH (TILESIZE / 10)
#define COORD(x) ( (x) * TILESIZE + BORDER )
#define FROMCOORD(x) ( ((x) - BORDER + TILESIZE) / TILESIZE - 1 )
ds->player_background = blitter_new(dr, TILESIZE, TILESIZE);
}
-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);
int i;
int coords[8];
coords[0] = tx+TILESIZE/2;
- coords[1] = ty+TILESIZE*1/7;
- coords[2] = tx+TILESIZE*1/7;
+ coords[1] = ty+TILESIZE/2-TILESIZE*5/14;
+ coords[2] = tx+TILESIZE/2-TILESIZE*5/14;
coords[3] = ty+TILESIZE/2;
coords[4] = tx+TILESIZE/2;
- coords[5] = ty+TILESIZE-TILESIZE*1/7;
- coords[6] = tx+TILESIZE-TILESIZE*1/7;
+ coords[5] = ty+TILESIZE/2+TILESIZE*5/14;
+ coords[6] = tx+TILESIZE/2+TILESIZE*5/14;
coords[7] = ty+TILESIZE/2;
draw_polygon(dr, coords, 4, COL_GEM, COL_OUTLINE);
return 0.0F;
}
-static int game_wants_statusbar(void)
-{
- return TRUE;
-}
-
static int game_timing_state(game_state *state, game_ui *ui)
{
return TRUE;
#endif
const struct game thegame = {
- "Inertia", "games.inertia",
+ "Inertia", "games.inertia", "inertia",
default_params,
game_fetch_preset,
decode_params,
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 */
};