aboutsummaryrefslogtreecommitdiff
path: root/signpost.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2012-01-22 15:52:14 +0000
committerSimon Tatham <anakin@pobox.com>2012-01-22 15:52:14 +0000
commit5e1c11ab6945cd96a267a8b15f527f80bc0e35f6 (patch)
tree0e4cb192259ebdcbc9d7c20629493e879816f7a2 /signpost.c
parent660216a1c47263d785e8299eb10782f4ed1900e7 (diff)
downloadpuzzles-5e1c11ab6945cd96a267a8b15f527f80bc0e35f6.zip
puzzles-5e1c11ab6945cd96a267a8b15f527f80bc0e35f6.tar.gz
puzzles-5e1c11ab6945cd96a267a8b15f527f80bc0e35f6.tar.bz2
puzzles-5e1c11ab6945cd96a267a8b15f527f80bc0e35f6.tar.xz
Trivial and silly patch to allow users to configure the Signpost
victory roll so that adjacent arrows rotate in opposite directions, giving the impression that they're an interlocking field of gears. Possibly even more brain-twisting than the original version :-) [originally from svn r9384]
Diffstat (limited to 'signpost.c')
-rw-r--r--signpost.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/signpost.c b/signpost.c
index 19649b2..5286b42 100644
--- a/signpost.c
+++ b/signpost.c
@@ -2094,11 +2094,33 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
if (state->nums[i] != ds->nums[i] ||
f != ds->f[i] || dirp != ds->dirp[i] ||
force || !ds->started) {
+ int sign;
+ {
+ /*
+ * Trivial and foolish configurable option done on
+ * purest whim. With this option enabled, the
+ * victory flash is done by rotating each square
+ * in the opposite direction from its immediate
+ * neighbours, so that they behave like a field of
+ * interlocking gears. With it disabled, they all
+ * rotate in the same direction. Choose for
+ * yourself which is more brain-twisting :-)
+ */
+ static int gear_mode = -1;
+ if (gear_mode < 0) {
+ char *env = getenv("SIGNPOST_GEARS");
+ gear_mode = (env && (env[0] == 'y' || env[0] == 'Y'));
+ }
+ if (gear_mode)
+ sign = 1 - 2 * ((x ^ y) & 1);
+ else
+ sign = 1;
+ }
tile_redraw(dr, ds,
BORDER + x * TILE_SIZE,
BORDER + y * TILE_SIZE,
state->dirs[i], dirp, state->nums[i], f,
- angle_offset, -1);
+ sign * angle_offset, -1);
ds->nums[i] = state->nums[i];
ds->f[i] = f;
ds->dirp[i] = dirp;