mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
I've dithered a bit in the past about whether or not it's allowable
to call game_set_size() twice on the same drawstate. Finally, a definite decision: it isn't. Accordingly, midend.c arranges never to do so, the devel docs state that puzzles may enforce by assertion that it never happens, and the four puzzles which care (i.e. use blitters) do so. [originally from svn r6274]
This commit is contained in:
11
midend.c
11
midend.c
@ -217,6 +217,17 @@ void midend_size(midend *me, int *x, int *y, int expand)
|
||||
int min, max;
|
||||
int rx, ry;
|
||||
|
||||
/*
|
||||
* We can't set the size on the same drawstate twice. So if
|
||||
* we've already sized one drawstate, we must throw it away and
|
||||
* create a new one.
|
||||
*/
|
||||
if (me->drawstate && me->tilesize > 0) {
|
||||
me->ourgame->free_drawstate(me->drawing, me->drawstate);
|
||||
me->drawstate = me->ourgame->new_drawstate(me->drawing,
|
||||
me->states[0].state);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the tile size that best fits within the given space. If
|
||||
* `expand' is TRUE, we must actually find the _largest_ such
|
||||
|
Reference in New Issue
Block a user