X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/6c42c563460ffaa9fd04b7e3f336646065f33992..96c92647f055deba9bfbf91f1198ab5d3b06cae4:/loopy.c diff --git a/loopy.c b/loopy.c index 71aaa31..7570219 100644 --- a/loopy.c +++ b/loopy.c @@ -66,7 +66,7 @@ #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 @@ -148,7 +148,7 @@ enum { #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) @@ -2078,7 +2078,7 @@ static void game_changed_state(game_ui *ui, game_state *oldstate, struct game_drawstate { int started; - int tilesize; + int tilesize, linewidth; int flashing; char *hl, *vl; char *clue_error; @@ -2360,6 +2360,7 @@ static void game_set_size(drawing *dr, game_drawstate *ds, 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) @@ -2388,7 +2389,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, game_state *state) { 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); @@ -2667,7 +2668,8 @@ static void game_print(drawing *dr, game_state *state, int tilesize) 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