diff options
| author | Simon Tatham <anakin@pobox.com> | 2021-04-27 07:08:08 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2021-04-27 07:08:08 +0100 |
| commit | 2d2d7e8678e55d555554203e3ffec44610bc2c25 (patch) | |
| tree | cd18c1de375fb3ad7e1d83823f44b0a7cf3747b4 | |
| parent | 091bef1a8264b677d711f2de1e765035d3d0e3c5 (diff) | |
| download | puzzles-2d2d7e8678e55d555554203e3ffec44610bc2c25.zip puzzles-2d2d7e8678e55d555554203e3ffec44610bc2c25.tar.gz puzzles-2d2d7e8678e55d555554203e3ffec44610bc2c25.tar.bz2 puzzles-2d2d7e8678e55d555554203e3ffec44610bc2c25.tar.xz | |
Reinsert some missing screen-clears.
I just introduced the 'first_draw' flag in the midend, which should
force a screen clear whenever we draw a puzzle with a fresh drawstate.
But in fact there were several places where the midend replaces the
drawstate and I hadn't set that flag to true.
In particular, a user just reported that when you press 'n' for a new
game in an existing Magnets window, the new puzzle's clues are drawn,
but any old clues in places where the new puzzle doesn't have one is
not _un_drawn. (Because Magnets has no code to undraw a single clue -
it never needs to!)
Added a set of first_draw wherever we call new_drawstate, which should
make this reliable again.
| -rw-r--r-- | midend.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -400,6 +400,7 @@ void midend_force_redraw(midend *me) me->ourgame->free_drawstate(me->drawing, me->drawstate); me->drawstate = me->ourgame->new_drawstate(me->drawing, me->states[0].state); + me->first_draw = true; midend_size_new_drawstate(me); midend_redraw(me); } @@ -539,6 +540,7 @@ void midend_new_game(midend *me) me->statepos = 1; me->drawstate = me->ourgame->new_drawstate(me->drawing, me->states[0].state); + me->first_draw = true; midend_size_new_drawstate(me); me->elapsed = 0.0F; me->flash_pos = me->flash_time = 0.0F; @@ -2340,6 +2342,7 @@ static const char *midend_deserialise_internal( data.states[0].state = me->ourgame->new_game( me, data.cparams, data.privdesc ? data.privdesc : data.desc); + for (i = 1; i < data.nstates; i++) { assert(data.states[i].movetype != NEWGAME); switch (data.states[i].movetype) { @@ -2458,6 +2461,7 @@ static const char *midend_deserialise_internal( me->drawstate = me->ourgame->new_drawstate(me->drawing, me->states[me->statepos-1].state); + me->first_draw = true; midend_size_new_drawstate(me); if (me->game_id_change_notify_function) me->game_id_change_notify_function(me->game_id_change_notify_ctx); |