diff options
| author | Simon Tatham <anakin@pobox.com> | 2013-04-07 10:44:56 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2013-04-07 10:44:56 +0000 |
| commit | 8cfcbac02795801b712e16492bbfeead35896b0c (patch) | |
| tree | 61d32ce8cae3830b2fb7c2a7fead37a5c9834759 | |
| parent | c0fff857fd910eb4af7eabd6ad08da554f694f43 (diff) | |
| download | puzzles-8cfcbac02795801b712e16492bbfeead35896b0c.zip puzzles-8cfcbac02795801b712e16492bbfeead35896b0c.tar.gz puzzles-8cfcbac02795801b712e16492bbfeead35896b0c.tar.bz2 puzzles-8cfcbac02795801b712e16492bbfeead35896b0c.tar.xz | |
Split Untangle's background colour into two. COL_BACKGROUND is still
defined the same way and used to draw the normal background of the
puzzle, but there's a new slightly darker COL_SYSBACKGROUND which is
not used for anything at all in the puzzle backend but which occupies
colour slot #0 so that the system will use it to fill around the
playable area if the puzzle is imprecisely resized.
This doesn't _sensibly fix_ the annoyance in Untangle where a non-
square window gives rise to unusable dead space, but it at least works
around it by making the dead space obviously something to stay away
from.
[originally from svn r9823]
| -rw-r--r-- | untangle.c | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -12,9 +12,15 @@ /* * TODO: - * - * - Any way we can speed up redraws on GTK? Uck. - * + * + * - This puzzle, perhaps uniquely among the collection, could use + * support for non-aspect-ratio-preserving resizes. This would + * require some sort of fairly large redesign, unfortunately (since + * it would invalidate the basic assumption that puzzles' size + * requirements are adequately expressed by a single scalar tile + * size), and probably complicate the rest of the puzzles' API as a + * result. So I'm not sure I really want to do it. + * * - It would be nice if we could somehow auto-detect a real `long * long' type on the host platform and use it in place of my * hand-hacked int64s. It'd be faster and more reliable. @@ -39,6 +45,7 @@ #define SOLVEANIM_TIME 0.50F enum { + COL_SYSBACKGROUND, COL_BACKGROUND, COL_LINE, #ifdef SHOW_CROSSINGS @@ -1200,7 +1207,15 @@ static float *game_colours(frontend *fe, int *ncolours) { float *ret = snewn(3 * NCOLOURS, float); - frontend_default_colour(fe, &ret[COL_BACKGROUND * 3]); + /* + * COL_BACKGROUND is what we use as the normal background colour. + * Unusually, though, it isn't colour #0: COL_SYSBACKGROUND, a bit + * darker, takes that place. This means that if the user resizes + * an Untangle window so as to change its aspect ratio, the + * still-square playable area will be distinguished from the dead + * space around it. + */ + game_mkhighlight(fe, ret, COL_BACKGROUND, -1, COL_SYSBACKGROUND); ret[COL_LINE * 3 + 0] = 0.0F; ret[COL_LINE * 3 + 1] = 0.0F; |