diff options
| author | Simon Tatham <anakin@pobox.com> | 2010-01-18 21:23:26 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2010-01-18 21:23:26 +0000 |
| commit | 9f96c12e9f56ab504ffbf11fda68b8f469da63fa (patch) | |
| tree | 530b8b0fbc2f9a76d4f53007fc959d0ce0b80819 /tents.c | |
| parent | 3c6280ef8b370ebbf9f5d15a7622d63462a8f3ed (diff) | |
| download | puzzles-9f96c12e9f56ab504ffbf11fda68b8f469da63fa.zip puzzles-9f96c12e9f56ab504ffbf11fda68b8f469da63fa.tar.gz puzzles-9f96c12e9f56ab504ffbf11fda68b8f469da63fa.tar.bz2 puzzles-9f96c12e9f56ab504ffbf11fda68b8f469da63fa.tar.xz | |
Fix from James H: in printing mode, the shared code between drawing
and printing must avoid referring to stuff in the game_drawstate,
since the game_drawstate isn't a real one.
[originally from svn r8851]
Diffstat (limited to 'tents.c')
| -rw-r--r-- | tents.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -2465,7 +2465,7 @@ static void int_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate, * changed) the numbers. */ for (x = 0; x < w; x++) { - if (ds->numbersdrawn[x] != errors[w*h+x]) { + if (printing || ds->numbersdrawn[x] != errors[w*h+x]) { char buf[80]; draw_rect(dr, COORD(x), COORD(h)+1, TILESIZE, BRBORDER-1, COL_BACKGROUND); @@ -2474,11 +2474,12 @@ static void int_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate, FONT_VARIABLE, TILESIZE/2, ALIGN_HCENTRE|ALIGN_VNORMAL, (errors[w*h+x] ? COL_ERROR : COL_GRID), buf); draw_update(dr, COORD(x), COORD(h)+1, TILESIZE, BRBORDER-1); - ds->numbersdrawn[x] = errors[w*h+x]; + if (!printing) + ds->numbersdrawn[x] = errors[w*h+x]; } } for (y = 0; y < h; y++) { - if (ds->numbersdrawn[w+y] != errors[w*h+w+y]) { + if (printing || ds->numbersdrawn[w+y] != errors[w*h+w+y]) { char buf[80]; draw_rect(dr, COORD(w)+1, COORD(y), BRBORDER-1, TILESIZE, COL_BACKGROUND); @@ -2487,7 +2488,8 @@ static void int_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate, FONT_VARIABLE, TILESIZE/2, ALIGN_HRIGHT|ALIGN_VCENTRE, (errors[w*h+w+y] ? COL_ERROR : COL_GRID), buf); draw_update(dr, COORD(w)+1, COORD(y), BRBORDER-1, TILESIZE); - ds->numbersdrawn[w+y] = errors[w*h+w+y]; + if (!printing) + ds->numbersdrawn[w+y] = errors[w*h+w+y]; } } |