#define PREFERRED_TILE_SIZE 32
#define TILE_SIZE (ds->tilesize)
-#define LINEWIDTH TILE_SIZE / 16
+#define LINEWIDTH (ds->linewidth)
#define BORDER (TILE_SIZE / 2)
#define FLASH_TIME 0.5F
#define ENCODE(upper,title,lower) #lower
#define CONFIG(upper,title,lower) ":" #title
enum { DIFFLIST(ENUM) DIFFCOUNT };
-static char const *const loopy_diffnames[] = { DIFFLIST(TITLE) };
+/* static char const *const loopy_diffnames[] = { DIFFLIST(TITLE) }; */
static char const loopy_diffchars[] = DIFFLIST(ENCODE);
#define DIFFCONFIG DIFFLIST(CONFIG)
}
}
- /* No point in doing sums like that if they're going to be wrong */
- assert(strlen(ret) == (size_t)len);
+ /*
+ * Ensure we haven't overrun the buffer we allocated (which we
+ * really shouldn't have, since we computed its maximum size).
+ * Note that this assert is <= rather than ==, because the
+ * solver is permitted to produce an incomplete solution in
+ * which case the buffer will be only partially used.
+ */
+ assert(strlen(ret) <= (size_t)len);
return ret;
}
struct game_drawstate {
int started;
- int tilesize;
+ int tilesize, linewidth;
int flashing;
char *hl, *vl;
char *clue_error;
game_params *params, int tilesize)
{
ds->tilesize = tilesize;
+ ds->linewidth = max(1,tilesize/16);
}
-static float *game_colours(frontend *fe, game_state *state, int *ncolours)
+static float *game_colours(frontend *fe, int *ncolours)
{
float *ret = snewn(4 * NCOLOURS, float);
{
struct game_drawstate *ds = snew(struct game_drawstate);
- ds->tilesize = 0;
+ ds->tilesize = ds->linewidth = 0;
ds->started = 0;
ds->hl = snewn(HL_COUNT(state), char);
ds->vl = snewn(VL_COUNT(state), char);
return 0.0F;
}
-static int game_wants_statusbar(void)
-{
- return FALSE;
-}
-
static int game_timing_state(game_state *state, game_ui *ui)
{
return TRUE;
int ink = print_mono_colour(dr, 0);
int x, y;
game_drawstate ads, *ds = &ads;
- ds->tilesize = tilesize;
+
+ game_set_size(dr, ds, NULL, tilesize);
/*
* Dots. I'll deliberately make the dots a bit wider than the
game_anim_length,
game_flash_length,
TRUE, FALSE, game_print_size, game_print,
- game_wants_statusbar,
+ FALSE, /* wants_statusbar */
FALSE, game_timing_state,
- 0, /* mouse_priorities */
+ 0, /* flags */
};