mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
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.
This commit is contained in:
4
midend.c
4
midend.c
@ -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);
|
||||
|
Reference in New Issue
Block a user