aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2021-09-10 08:55:01 +0100
committerSimon Tatham <anakin@pobox.com>2021-09-10 08:55:01 +0100
commitd204978391141a68b338732ce24271402392534f (patch)
treef7fd1326de54710f20c40cbcfe2656aed1381d40
parent6691ad180cdd6f80673c49392c401ba8d6c5d3e7 (diff)
downloadpuzzles-d204978391141a68b338732ce24271402392534f.zip
puzzles-d204978391141a68b338732ce24271402392534f.tar.gz
puzzles-d204978391141a68b338732ce24271402392534f.tar.bz2
puzzles-d204978391141a68b338732ce24271402392534f.tar.xz
Tents: reinstate bottom and right grid borders.
They disappeared in commit c0da615a933a667: I removed all the per-puzzle code that erased the whole game window on first draw, and accidentally also took out the code that drew the Tents grid. Each individual grid tile includes its left and top grid lines, so most of the grid ended up being drawn anyway by draw_tile(). But the right and bottom borders aren't within any tile, so they weren't.
-rw-r--r--tents.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tents.c b/tents.c
index c4a7d35..5eb34b0 100644
--- a/tents.c
+++ b/tents.c
@@ -1461,6 +1461,7 @@ static void game_changed_state(game_ui *ui, const game_state *oldstate,
struct game_drawstate {
int tilesize;
+ bool started;
game_params p;
int *drawn, *numbersdrawn;
int cx, cy; /* last-drawn cursor pos, or (-1,-1) if absent. */
@@ -1939,6 +1940,7 @@ static game_drawstate *game_new_drawstate(drawing *dr, const game_state *state)
int i;
ds->tilesize = 0;
+ ds->started = false;
ds->p = state->p; /* structure copy */
ds->drawn = snewn(w*h, int);
for (i = 0; i < w*h; i++)
@@ -2408,11 +2410,13 @@ static void int_redraw(drawing *dr, game_drawstate *ds,
if (cx != ds->cx || cy != ds->cy) cmoved = true;
}
- if (printing) {
+ if (printing || !ds->started) {
+ if (printing)
+ print_line_width(dr, TILESIZE/64);
+
/*
* Draw the grid.
*/
- print_line_width(dr, TILESIZE/64);
for (y = 0; y <= h; y++)
draw_line(dr, COORD(0), COORD(y), COORD(w), COORD(y), COL_GRID);
for (x = 0; x <= w; x++)