aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2013-10-09 20:44:50 +0000
committerSimon Tatham <anakin@pobox.com>2013-10-09 20:44:50 +0000
commit96626d9c10bd37d060f9cf843b717350c222a344 (patch)
tree72117cf1c2d53137f6526b5f390a14b798f63627
parente2b35b2fc4a2758b09cd2d556d5c058486e91573 (diff)
downloadpuzzles-96626d9c10bd37d060f9cf843b717350c222a344.zip
puzzles-96626d9c10bd37d060f9cf843b717350c222a344.tar.gz
puzzles-96626d9c10bd37d060f9cf843b717350c222a344.tar.bz2
puzzles-96626d9c10bd37d060f9cf843b717350c222a344.tar.xz
Faintly highlight the leading diagonal of Group's grid.
This makes it easier to spot elements whose square is known, which is useful in turn for identifying subgroups. [originally from svn r10050]
-rw-r--r--unfinished/group.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/unfinished/group.c b/unfinished/group.c
index 1c397e1..74a63fc 100644
--- a/unfinished/group.c
+++ b/unfinished/group.c
@@ -62,6 +62,7 @@ enum {
COL_HIGHLIGHT,
COL_ERROR,
COL_PENCIL,
+ COL_DIAGONAL,
NCOLOURS
};
@@ -1495,6 +1496,10 @@ static float *game_colours(frontend *fe, int *ncolours)
ret[COL_PENCIL * 3 + 1] = 0.5F * ret[COL_BACKGROUND * 3 + 1];
ret[COL_PENCIL * 3 + 2] = ret[COL_BACKGROUND * 3 + 2];
+ ret[COL_DIAGONAL * 3 + 0] = 0.95F * ret[COL_BACKGROUND * 3 + 0];
+ ret[COL_DIAGONAL * 3 + 1] = 0.95F * ret[COL_BACKGROUND * 3 + 1];
+ ret[COL_DIAGONAL * 3 + 2] = 0.95F * ret[COL_BACKGROUND * 3 + 2];
+
*ncolours = NCOLOURS;
return ret;
}
@@ -1561,7 +1566,8 @@ static void draw_tile(drawing *dr, game_drawstate *ds, int x, int y, long tile,
/* background needs erasing */
draw_rect(dr, cx, cy, cw, ch,
- (tile & DF_HIGHLIGHT) ? COL_HIGHLIGHT : COL_BACKGROUND);
+ (tile & DF_HIGHLIGHT) ? COL_HIGHLIGHT :
+ (x == y) ? COL_DIAGONAL : COL_BACKGROUND);
/* dividers */
if (tile & DF_DIVIDER_TOP)