From 8a8474a31191804890c2fed03173832f0d81d81e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 23 Sep 2005 12:50:51 +0000 Subject: 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] --- map.c | 1 + 1 file changed, 1 insertion(+) (limited to 'map.c') diff --git a/map.c b/map.c index b06e664..6302ef7 100644 --- a/map.c +++ b/map.c @@ -2956,6 +2956,7 @@ static void game_print(drawing *dr, game_state *state, int tilesize) /* Ick: fake up `ds->tilesize' for macro expansion purposes */ struct { int tilesize; } ads, *ds = &ads; + /* We can't call game_set_size() here because we don't want a blitter */ ads.tilesize = tilesize; ink = print_mono_colour(dr, 0); -- cgit v1.1