mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Guess: move hold marker upward by two pixels
This means that it now potentially overlaps the peg above it (part of the current guess), rather than potentially overlapping the empty hole below. More importantly, it means that the hold marker is erased by the erasure of the rest of the peg area, so there's no need to explicitly draw absent hold markers in the background colour. That in turn means that absent hold markers don't nibble the tops off all the pegs at some tile sizes. Instead of this fix, I could have properly made the hold markers part of the first row of empty holes, but that would have been rather fiddly and I've long thought that the hold markers were too far from the peg that they're holding. I've also removed part of a comment about the drawing order of hold markers that seems to have been obsolete even before this commit.
This commit is contained in:
17
guess.c
17
guess.c
@ -1291,15 +1291,17 @@ static void guess_redraw(drawing *dr, game_drawstate *ds, int guess,
|
|||||||
if ((dest->pegs[i] != scol) || force) {
|
if ((dest->pegs[i] != scol) || force) {
|
||||||
draw_peg(dr, ds, rowx + PEGOFF * i, rowy, false, labelled,
|
draw_peg(dr, ds, rowx + PEGOFF * i, rowy, false, labelled,
|
||||||
scol &~ 0x7000);
|
scol &~ 0x7000);
|
||||||
|
if (scol & 0x1000)
|
||||||
|
draw_cursor(dr, ds, rowx + PEGOFF * i, rowy);
|
||||||
/*
|
/*
|
||||||
* Hold marker.
|
* Hold marker.
|
||||||
*/
|
*/
|
||||||
draw_rect(dr, rowx + PEGOFF * i, rowy + PEGSZ + ds->gapsz/2,
|
if (scol & 0x2000) {
|
||||||
PEGSZ, 2, (scol & 0x2000 ? COL_HOLD : COL_BACKGROUND));
|
draw_rect(dr, rowx + PEGOFF * i,
|
||||||
draw_update(dr, rowx + PEGOFF * i, rowy + PEGSZ + ds->gapsz/2,
|
rowy + PEGSZ + ds->gapsz/2 - 2, PEGSZ, 2, COL_HOLD);
|
||||||
PEGSZ, 2);
|
}
|
||||||
if (scol & 0x1000)
|
draw_update(dr, rowx + PEGOFF * i,
|
||||||
draw_cursor(dr, ds, rowx + PEGOFF * i, rowy);
|
rowy + PEGSZ + ds->gapsz/2 - 2, PEGSZ, 2);
|
||||||
}
|
}
|
||||||
dest->pegs[i] = scol;
|
dest->pegs[i] = scol;
|
||||||
}
|
}
|
||||||
@ -1424,8 +1426,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draw the guesses (so far) and the hints
|
/* draw the guesses (so far) and the hints (postponing the
|
||||||
* (in reverse order to avoid trampling holds, and postponing the
|
|
||||||
* next_go'th to not overrender the top of the circular cursor) */
|
* next_go'th to not overrender the top of the circular cursor) */
|
||||||
for (i = state->params.nguesses - 1; i >= 0; i--) {
|
for (i = state->params.nguesses - 1; i >= 0; i--) {
|
||||||
if (i < state->next_go || state->solved) {
|
if (i < state->next_go || state->solved) {
|
||||||
|
Reference in New Issue
Block a user