diff options
| author | Simon Tatham <anakin@pobox.com> | 2007-07-31 17:04:20 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2007-07-31 17:04:20 +0000 |
| commit | 2842817eda5892783a8287b8d32d1b3baeb11dc8 (patch) | |
| tree | ccdaa2167735b0142ba7a6ac2124e39704c82624 /lightup.c | |
| parent | 519b7de9734a33fd7cf7560ec443a1c9b4d736e5 (diff) | |
| download | puzzles-2842817eda5892783a8287b8d32d1b3baeb11dc8.zip puzzles-2842817eda5892783a8287b8d32d1b3baeb11dc8.tar.gz puzzles-2842817eda5892783a8287b8d32d1b3baeb11dc8.tar.bz2 puzzles-2842817eda5892783a8287b8d32d1b3baeb11dc8.tar.xz | |
Experimental UI tweak enabled by a hacky environment variable:
suppress the display of `this square can't be a light' blobs in a
lit square, on the grounds that we already know _lit_ squares can't
be lights. This makes the solved game look cleaner (I've always
thought the detritus of blobs on some but not all non-light squares
looked messy), but on the other hand it's slightly jarring during
play. So I'm checking it in, but as a configurable option which is
off by default.
[originally from svn r7656]
Diffstat (limited to 'lightup.c')
| -rw-r--r-- | lightup.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -2077,10 +2077,19 @@ static void tile_redraw(drawing *dr, game_drawstate *ds, game_state *state, int lcol = (ds_flags & DF_OVERLAP) ? COL_ERROR : COL_LIGHT; draw_circle(dr, dx + TILE_SIZE/2, dy + TILE_SIZE/2, TILE_RADIUS, lcol, COL_BLACK); - } else if (ds_flags & DF_IMPOSSIBLE) { - int rlen = TILE_SIZE / 4; - draw_rect(dr, dx + TILE_SIZE/2 - rlen/2, dy + TILE_SIZE/2 - rlen/2, - rlen, rlen, COL_BLACK); + } else if ((ds_flags & DF_IMPOSSIBLE)) { + static int draw_blobs_when_lit = -1; + if (draw_blobs_when_lit < 0) { + char *env = getenv("LIGHTUP_LIT_BLOBS"); + draw_blobs_when_lit = (!env || (env[0] == 'y' || + env[0] == 'Y')); + } + if (!(ds_flags & DF_LIT) || draw_blobs_when_lit) { + int rlen = TILE_SIZE / 4; + draw_rect(dr, dx + TILE_SIZE/2 - rlen/2, + dy + TILE_SIZE/2 - rlen/2, + rlen, rlen, COL_BLACK); + } } } |