aboutsummaryrefslogtreecommitdiff
path: root/loopy.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-09-23 12:50:51 +0000
committerSimon Tatham <anakin@pobox.com>2005-09-23 12:50:51 +0000
commit8a8474a31191804890c2fed03173832f0d81d81e (patch)
tree353fdda26cc8cfe8d52efed00cd9ab1d9b3f53a4 /loopy.c
parent733e3c6bc741cd1322b00545f600a548fac32563 (diff)
downloadpuzzles-8a8474a31191804890c2fed03173832f0d81d81e.zip
puzzles-8a8474a31191804890c2fed03173832f0d81d81e.tar.gz
puzzles-8a8474a31191804890c2fed03173832f0d81d81e.tar.bz2
puzzles-8a8474a31191804890c2fed03173832f0d81d81e.tar.xz
Use game_set_size() to set up the temporary drawstate in
game_print(), wherever feasible. This fixes a specific bug in Loopy (James H's new field ds->linewidth wasn't being set up, leading to corrupted print output), but I've made the change in all affected files because it also seems like a generally good idea to encourage it for future games, to prevent other problems of this type. There is one slight snag, which is that Map _can't_ do this because its game_set_size() also initialises a blitter. I could fix this by abstracting the common parts of Map's game_set_size() out into a subfunction called by game_set_size() and also called directly by game_print(); alternatively, I could introduce a means of determining whether a `drawing *' was for screen or printing use. Not sure which yet. [originally from svn r6340]
Diffstat (limited to 'loopy.c')
-rw-r--r--loopy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/loopy.c b/loopy.c
index 3423465..6006c87 100644
--- a/loopy.c
+++ b/loopy.c
@@ -2668,7 +2668,8 @@ static void game_print(drawing *dr, game_state *state, int tilesize)
int ink = print_mono_colour(dr, 0);
int x, y;
game_drawstate ads, *ds = &ads;
- ds->tilesize = tilesize;
+
+ game_set_size(dr, ds, NULL, tilesize);
/*
* Dots. I'll deliberately make the dots a bit wider than the