mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
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]
This commit is contained in:
18
fifteen.c
18
fifteen.c
@ -635,7 +635,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
|
|||||||
bgcolour = COL_BACKGROUND;
|
bgcolour = COL_BACKGROUND;
|
||||||
|
|
||||||
if (!ds->started) {
|
if (!ds->started) {
|
||||||
int coords[6];
|
int coords[10];
|
||||||
|
|
||||||
draw_rect(fe, 0, 0,
|
draw_rect(fe, 0, 0,
|
||||||
TILE_SIZE * state->w + 2 * BORDER,
|
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[1] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
|
||||||
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
|
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
|
||||||
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
coords[4] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[4] = coords[2] - TILE_SIZE;
|
||||||
coords[5] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
|
coords[5] = coords[3] + TILE_SIZE;
|
||||||
draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
|
coords[8] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
|
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[1] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
|
draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
|
||||||
draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
|
draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
|
||||||
|
|
||||||
ds->started = TRUE;
|
ds->started = TRUE;
|
||||||
}
|
}
|
||||||
|
18
mines.c
18
mines.c
@ -2859,7 +2859,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
|
|||||||
bg = COL_BACKGROUND;
|
bg = COL_BACKGROUND;
|
||||||
|
|
||||||
if (!ds->started) {
|
if (!ds->started) {
|
||||||
int coords[6];
|
int coords[10];
|
||||||
|
|
||||||
draw_rect(fe, 0, 0,
|
draw_rect(fe, 0, 0,
|
||||||
TILE_SIZE * state->w + 2 * BORDER,
|
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[1] = COORD(state->h) + OUTER_HIGHLIGHT_WIDTH - 1;
|
||||||
coords[2] = COORD(state->w) + OUTER_HIGHLIGHT_WIDTH - 1;
|
coords[2] = COORD(state->w) + OUTER_HIGHLIGHT_WIDTH - 1;
|
||||||
coords[3] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
|
coords[3] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
|
||||||
coords[4] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
|
coords[4] = coords[2] - TILE_SIZE;
|
||||||
coords[5] = COORD(state->h) + OUTER_HIGHLIGHT_WIDTH - 1;
|
coords[5] = coords[3] + TILE_SIZE;
|
||||||
draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
|
coords[8] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
|
||||||
draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
|
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[1] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
|
||||||
coords[0] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
|
coords[0] = COORD(0) - OUTER_HIGHLIGHT_WIDTH;
|
||||||
draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
|
draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
|
||||||
draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
|
draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
|
||||||
|
|
||||||
ds->started = TRUE;
|
ds->started = TRUE;
|
||||||
}
|
}
|
||||||
|
18
sixteen.c
18
sixteen.c
@ -774,7 +774,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
|
|||||||
bgcolour = COL_BACKGROUND;
|
bgcolour = COL_BACKGROUND;
|
||||||
|
|
||||||
if (!ds->started) {
|
if (!ds->started) {
|
||||||
int coords[6];
|
int coords[10];
|
||||||
|
|
||||||
draw_rect(fe, 0, 0,
|
draw_rect(fe, 0, 0,
|
||||||
TILE_SIZE * state->w + 2 * BORDER,
|
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[1] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
|
||||||
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
|
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
|
||||||
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
coords[4] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[4] = coords[2] - TILE_SIZE;
|
||||||
coords[5] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
|
coords[5] = coords[3] + TILE_SIZE;
|
||||||
draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
|
coords[8] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
|
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[1] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
|
draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
|
||||||
draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
|
draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Arrows for making moves.
|
* Arrows for making moves.
|
||||||
|
18
twiddle.c
18
twiddle.c
@ -1005,7 +1005,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
|
|||||||
bgcolour = COL_BACKGROUND;
|
bgcolour = COL_BACKGROUND;
|
||||||
|
|
||||||
if (!ds->started) {
|
if (!ds->started) {
|
||||||
int coords[6];
|
int coords[10];
|
||||||
|
|
||||||
draw_rect(fe, 0, 0,
|
draw_rect(fe, 0, 0,
|
||||||
TILE_SIZE * state->w + 2 * BORDER,
|
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[1] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
|
||||||
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
|
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
|
||||||
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
coords[4] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[4] = coords[2] - TILE_SIZE;
|
||||||
coords[5] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
|
coords[5] = coords[3] + TILE_SIZE;
|
||||||
draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
|
coords[8] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
|
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[1] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
|
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
|
||||||
draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
|
draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
|
||||||
draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
|
draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
|
||||||
|
|
||||||
ds->started = TRUE;
|
ds->started = TRUE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user