X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/48a10826fef7777bb8b061f4a121f481ced98bc0..daaccee83ed942715e01ce256cd94340605bf330:/twiddle.c diff --git a/twiddle.c b/twiddle.c index b03ca01..589dbe6 100644 --- a/twiddle.c +++ b/twiddle.c @@ -492,7 +492,7 @@ static game_state *solve_game(game_state *state, game_aux_info *aux, for (i = 0; i < ret->w*ret->h; i++) ret->grid[i] &= ~3; ret->used_solve = ret->just_used_solve = TRUE; - ret->completed = ret->movecount; + ret->completed = ret->movecount = 1; return ret; } @@ -693,6 +693,16 @@ static void draw_tile(frontend *fe, game_state *state, int x, int y, int coords[8]; char str[40]; + /* + * If we've been passed a rotation region but we're drawing a + * tile which is outside it, we must draw it normally. This can + * occur if we're cleaning up after a completion flash while a + * new move is also being made. + */ + if (rot && (x < rot->cx || y < rot->cy || + x >= rot->cx+rot->cw || y >= rot->cy+rot->ch)) + rot = NULL; + if (rot) clip(fe, rot->cx, rot->cy, rot->cw, rot->ch); @@ -763,7 +773,7 @@ static void draw_tile(frontend *fe, game_state *state, int x, int y, } /* - * Next, the colour bars for orientation. + * Next, the triangles for orientation. */ if (state->orientable) { int xdx, xdy, ydx, ydy;