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:
Simon Tatham
2005-09-05 17:18:03 +00:00
parent fd1735170e
commit 56ff3647e2
6 changed files with 21 additions and 10 deletions

View File

@ -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