static char const *const diffnames[] = { DIFFLIST(TITLE) };
static char const diffchars[] = DIFFLIST(ENCODE);
#define DIFFCONFIG DIFFLIST(CONFIG)
-DIFFLIST(SOLVER_FN_DECL);
+DIFFLIST(SOLVER_FN_DECL)
static int (*(solver_fns[]))(solver_state *) = { DIFFLIST(SOLVER_FN) };
struct game_params {
static char const *const gridnames[] = { GRIDLIST(GRID_NAME) };
#define GRID_CONFIGS GRIDLIST(GRID_CONFIG)
static grid * (*(grid_fns[]))(int w, int h) = { GRIDLIST(GRID_FN) };
-static const int NUM_GRID_TYPES = sizeof(grid_fns) / sizeof(grid_fns[0]);
+#define NUM_GRID_TYPES (sizeof(grid_fns) / sizeof(grid_fns[0]))
/* Generates a (dynamically allocated) new grid, according to the
* type and size requested in params. Does nothing if the grid is already
}
static const game_params presets[] = {
+#ifdef SMALL_SCREEN
+ { 7, 7, DIFF_EASY, 0, NULL },
+ { 7, 7, DIFF_NORMAL, 0, NULL },
+ { 7, 7, DIFF_HARD, 0, NULL },
+ { 7, 7, DIFF_HARD, 1, NULL },
+ { 7, 7, DIFF_HARD, 2, NULL },
+ { 5, 5, DIFF_HARD, 3, NULL },
+ { 7, 7, DIFF_HARD, 4, NULL },
+ { 5, 4, DIFF_HARD, 5, NULL },
+ { 5, 5, DIFF_HARD, 6, NULL },
+ { 5, 5, DIFF_HARD, 7, NULL },
+#else
{ 7, 7, DIFF_EASY, 0, NULL },
{ 10, 10, DIFF_EASY, 0, NULL },
{ 7, 7, DIFF_NORMAL, 0, NULL },
{ 5, 4, DIFF_HARD, 5, NULL },
{ 7, 7, DIFF_HARD, 6, NULL },
{ 5, 5, DIFF_HARD, 7, NULL },
+#endif
};
static int game_fetch_preset(int i, char **name, game_params **params)
* bounding-box around the line, then flag all nearby objects for redraw.
*/
if (ds->started) {
- const char redraw_flag = 1<<7;
+ const char redraw_flag = (char)(1<<7);
for (i = 0; i < g->num_edges; i++) {
/* If we're changing state, AND
* the previous state was a coloured line */
* direction to create a thin rectangle. */
int dx = (x1 > x2) ? -1 : ((x1 < x2) ? 1 : 0);
int dy = (y1 > y2) ? -1 : ((y1 < y2) ? 1 : 0);
- int points[] = {
- x1 + dy, y1 - dx,
- x1 - dy, y1 + dx,
- x2 - dy, y2 + dx,
- x2 + dy, y2 - dx
- };
+ int points[8];
+ points[0] = x1 + dy;
+ points[1] = y1 - dx;
+ points[2] = x1 - dy;
+ points[3] = y1 + dx;
+ points[4] = x2 - dy;
+ points[5] = y2 + dx;
+ points[6] = x2 + dy;
+ points[7] = y2 - dx;
draw_polygon(dr, points, 4, line_colour, line_colour);
}
if (ds->started) {
dx = (dx * ds->tilesize) / thickness;
dy = (dy * ds->tilesize) / thickness;
- points[0] = x1 + dy;
- points[1] = y1 - dx;
- points[2] = x1 - dy;
- points[3] = y1 + dx;
- points[4] = x2 - dy;
- points[5] = y2 + dx;
- points[6] = x2 + dy;
- points[7] = y2 - dx;
+ points[0] = x1 + (int)dy;
+ points[1] = y1 - (int)dx;
+ points[2] = x1 - (int)dy;
+ points[3] = y1 + (int)dx;
+ points[4] = x2 - (int)dy;
+ points[5] = y2 + (int)dx;
+ points[6] = x2 + (int)dy;
+ points[7] = y2 - (int)dx;
draw_polygon(dr, points, 4, ink, ink);
}
else