From a3c5409af26b5596c47a48a4b7e706d30da5da24 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 30 Apr 2004 10:17:22 +0000 Subject: [PATCH] Keep the status bar in better sync with the game display. [originally from svn r4177] --- fifteen.c | 7 +++++++ sixteen.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/fifteen.c b/fifteen.c index b3285e7..338bdfb 100644 --- a/fifteen.c +++ b/fifteen.c @@ -554,6 +554,13 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate, { char statusbuf[256]; + /* + * Don't show the new status until we're also showing the + * new _state_ - after the game animation is complete. + */ + if (oldstate) + state = oldstate; + sprintf(statusbuf, "%sMoves: %d", (state->completed ? "COMPLETED! " : ""), (state->completed ? state->completed : state->movecount)); diff --git a/sixteen.c b/sixteen.c index 89eef4f..3ea115c 100644 --- a/sixteen.c +++ b/sixteen.c @@ -599,6 +599,13 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate, { char statusbuf[256]; + /* + * Don't show the new status until we're also showing the + * new _state_ - after the game animation is complete. + */ + if (oldstate) + state = oldstate; + sprintf(statusbuf, "%sMoves: %d", (state->completed ? "COMPLETED! " : ""), (state->completed ? state->completed : state->movecount)); -- 2.30.2