aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-06-01 07:22:21 +0000
committerSimon Tatham <anakin@pobox.com>2005-06-01 07:22:21 +0000
commit42a2d7d61cff442ac67c038650f9f50cf0f19594 (patch)
tree0a5e9b848203e0eaffc48a1c34238552fce3624e
parent5b5fc1417ba70e670d1d84fa8cae535eb4f87f23 (diff)
downloadpuzzles-42a2d7d61cff442ac67c038650f9f50cf0f19594.zip
puzzles-42a2d7d61cff442ac67c038650f9f50cf0f19594.tar.gz
puzzles-42a2d7d61cff442ac67c038650f9f50cf0f19594.tar.bz2
puzzles-42a2d7d61cff442ac67c038650f9f50cf0f19594.tar.xz
Gareth points out that the recess highlights around the outside of
the grid, in all games that have them, are drawn incorrectly when the grid is not square. Fixed. [originally from svn r5893]
-rw-r--r--fifteen.c18
-rw-r--r--mines.c18
-rw-r--r--sixteen.c18
-rw-r--r--twiddle.c18
4 files changed, 44 insertions, 28 deletions
diff --git a/fifteen.c b/fifteen.c
index 6749093..4b37dd7 100644
--- a/fifteen.c
+++ b/fifteen.c
@@ -635,7 +635,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
bgcolour = COL_BACKGROUND;
if (!ds->started) {
- int coords[6];
+ int coords[10];
draw_rect(fe, 0, 0,
TILE_SIZE * state->w + 2 * BORDER,
@@ -651,15 +651,19 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
coords[1] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
- coords[4] = COORD(0) - HIGHLIGHT_WIDTH;
- coords[5] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
- draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
+ coords[4] = coords[2] - TILE_SIZE;
+ coords[5] = coords[3] + TILE_SIZE;
+ coords[8] = COORD(0) - HIGHLIGHT_WIDTH;
+ coords[9] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
+ coords[6] = coords[8] + TILE_SIZE;
+ coords[7] = coords[9] - TILE_SIZE;
+ draw_polygon(fe, coords, 5, TRUE, COL_HIGHLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_HIGHLIGHT);
coords[1] = COORD(0) - HIGHLIGHT_WIDTH;
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
- draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
ds->started = TRUE;
}
diff --git a/mines.c b/mines.c
index 6a3d7aa..4fa63d1 100644
--- a/mines.c
+++ b/mines.c
@@ -2859,7 +2859,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
bg = COL_BACKGROUND;
if (!ds->started) {
- int coords[6];
+ int coords[10];
draw_rect(fe, 0, 0,
TILE_SIZE * state->w + 2 * BORDER,
@@ -2875,15 +2875,19 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
coords[1] = COORD(state->h) + OUTER_HIGHLIGHT_WIDTH - 1;
coords[2] = COORD(state->w) + OUTER_HIGHLIGHT_WIDTH - 1;
coords[3] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
- coords[4] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
- coords[5] = COORD(state->h) + OUTER_HIGHLIGHT_WIDTH - 1;
- draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
+ coords[4] = coords[2] - TILE_SIZE;
+ coords[5] = coords[3] + TILE_SIZE;
+ coords[8] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
+ coords[9] = COORD(state->h) + OUTER_HIGHLIGHT_WIDTH - 1;
+ coords[6] = coords[8] + TILE_SIZE;
+ coords[7] = coords[9] - TILE_SIZE;
+ draw_polygon(fe, coords, 5, TRUE, COL_HIGHLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_HIGHLIGHT);
coords[1] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
coords[0] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
- draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
ds->started = TRUE;
}
diff --git a/sixteen.c b/sixteen.c
index 70abe13..744e01d 100644
--- a/sixteen.c
+++ b/sixteen.c
@@ -774,7 +774,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
bgcolour = COL_BACKGROUND;
if (!ds->started) {
- int coords[6];
+ int coords[10];
draw_rect(fe, 0, 0,
TILE_SIZE * state->w + 2 * BORDER,
@@ -790,15 +790,19 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
coords[1] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
- coords[4] = COORD(0) - HIGHLIGHT_WIDTH;
- coords[5] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
- draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
+ coords[4] = coords[2] - TILE_SIZE;
+ coords[5] = coords[3] + TILE_SIZE;
+ coords[8] = COORD(0) - HIGHLIGHT_WIDTH;
+ coords[9] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
+ coords[6] = coords[8] + TILE_SIZE;
+ coords[7] = coords[9] - TILE_SIZE;
+ draw_polygon(fe, coords, 5, TRUE, COL_HIGHLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_HIGHLIGHT);
coords[1] = COORD(0) - HIGHLIGHT_WIDTH;
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
- draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
/*
* Arrows for making moves.
diff --git a/twiddle.c b/twiddle.c
index 66c4d8b..e66bdb0 100644
--- a/twiddle.c
+++ b/twiddle.c
@@ -1005,7 +1005,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
bgcolour = COL_BACKGROUND;
if (!ds->started) {
- int coords[6];
+ int coords[10];
draw_rect(fe, 0, 0,
TILE_SIZE * state->w + 2 * BORDER,
@@ -1021,15 +1021,19 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
coords[1] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
- coords[4] = COORD(0) - HIGHLIGHT_WIDTH;
- coords[5] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
- draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
+ coords[4] = coords[2] - TILE_SIZE;
+ coords[5] = coords[3] + TILE_SIZE;
+ coords[8] = COORD(0) - HIGHLIGHT_WIDTH;
+ coords[9] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
+ coords[6] = coords[8] + TILE_SIZE;
+ coords[7] = coords[9] - TILE_SIZE;
+ draw_polygon(fe, coords, 5, TRUE, COL_HIGHLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_HIGHLIGHT);
coords[1] = COORD(0) - HIGHLIGHT_WIDTH;
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
- draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
ds->started = TRUE;
}