X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/8ef49e1d6982dd55a55c27c84806abedc895aeb5..efdb908d51a58cf7e46bdcf7e4d7ec405eede69d:/signpost.c diff --git a/signpost.c b/signpost.c index 6b16ff7..5286b42 100644 --- a/signpost.c +++ b/signpost.c @@ -1812,8 +1812,8 @@ static int num2col(game_drawstate *ds, int num) { int set = num / (ds->n+1); - if (num <= 0) return COL_B0; - return COL_B0 + (set % 16); + if (num <= 0 || set == 0) return COL_B0; + return COL_B0 + 1 + ((set-1) % 15); } #define ARROW_HALFSZ (7 * TILE_SIZE / 32) @@ -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;