aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-08-09 18:09:07 +0000
committerSimon Tatham <anakin@pobox.com>2005-08-09 18:09:07 +0000
commit8da47177f37ff8859fec8a45193a749e61321c14 (patch)
tree075b1f99f48ab91283bfe6ffb52d2aaa70356b37
parent2bd8e241a93165a99f5e2c4a2dd9c3b3b1e3c6f3 (diff)
downloadpuzzles-8da47177f37ff8859fec8a45193a749e61321c14.zip
puzzles-8da47177f37ff8859fec8a45193a749e61321c14.tar.gz
puzzles-8da47177f37ff8859fec8a45193a749e61321c14.tar.bz2
puzzles-8da47177f37ff8859fec8a45193a749e61321c14.tar.xz
Very fiddly corrections to the loop highlighting. ERRSLASH means the
slash in this square is red, so it does indeed imply that some of the edge markings are also red; but it doesn't mean _all_ the edge markings must be red. So instead of assuming ERRSLASH implies all edge error markers, we set the correct set of edge error markers at the same time as setting ERRSLASH, at which point we know which kind of slash it is so we know which ones to set. [originally from svn r6175]
-rw-r--r--slant.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/slant.c b/slant.c
index eb77268..3bb5405 100644
--- a/slant.c
+++ b/slant.c
@@ -1735,19 +1735,19 @@ static void draw_tile(frontend *fe, game_drawstate *ds, game_clues *clues,
*/
if (v & (L_T | BACKSLASH))
draw_rect(fe, COORD(x), COORD(y)+1, 1, 1,
- (v & (ERR_L_T | ERRSLASH) ? COL_ERROR : bscol));
+ (v & ERR_L_T ? COL_ERROR : bscol));
if (v & (L_B | FORWSLASH))
draw_rect(fe, COORD(x), COORD(y+1)-1, 1, 1,
- (v & (ERR_L_B | ERRSLASH) ? COL_ERROR : fscol));
+ (v & ERR_L_B ? COL_ERROR : fscol));
if (v & (T_L | BACKSLASH))
draw_rect(fe, COORD(x)+1, COORD(y), 1, 1,
- (v & (ERR_T_L | ERRSLASH) ? COL_ERROR : bscol));
+ (v & ERR_T_L ? COL_ERROR : bscol));
if (v & (T_R | FORWSLASH))
draw_rect(fe, COORD(x+1)-1, COORD(y), 1, 1,
- (v & (ERR_T_R | ERRSLASH) ? COL_ERROR : fscol));
+ (v & ERR_T_R ? COL_ERROR : fscol));
if (v & (C_TL | BACKSLASH))
draw_rect(fe, COORD(x), COORD(y), 1, 1,
- (v & (ERR_C_TL | ERRSLASH) ? COL_ERROR : bscol));
+ (v & ERR_C_TL ? COL_ERROR : bscol));
/*
* And finally the clues at the corners.
@@ -1809,7 +1809,8 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
ds->todraw[(y+1)*(w+2)+(x+2)] |= L_B;
ds->todraw[(y+2)*(w+2)+(x+2)] |= C_TL;
if (err) {
- ds->todraw[(y+1)*(w+2)+(x+1)] |= ERRSLASH;
+ ds->todraw[(y+1)*(w+2)+(x+1)] |= ERRSLASH |
+ ERR_T_L | ERR_L_T | ERR_C_TL;
ds->todraw[(y+2)*(w+2)+(x+1)] |= ERR_T_R;
ds->todraw[(y+1)*(w+2)+(x+2)] |= ERR_L_B;
ds->todraw[(y+2)*(w+2)+(x+2)] |= ERR_C_TL;
@@ -1819,7 +1820,8 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
ds->todraw[(y+1)*(w+2)+(x+2)] |= L_T | C_TL;
ds->todraw[(y+2)*(w+2)+(x+1)] |= T_L | C_TL;
if (err) {
- ds->todraw[(y+1)*(w+2)+(x+1)] |= ERRSLASH;
+ ds->todraw[(y+1)*(w+2)+(x+1)] |= ERRSLASH |
+ ERR_L_B | ERR_T_R;
ds->todraw[(y+1)*(w+2)+(x+2)] |= ERR_L_T | ERR_C_TL;
ds->todraw[(y+2)*(w+2)+(x+1)] |= ERR_T_L | ERR_C_TL;
}