Keep the status bar in better sync with the game display.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 30 Apr 2004 10:17:22 +0000 (10:17 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 30 Apr 2004 10:17:22 +0000 (10:17 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4177 cda61777-01e9-0310-a592-d414129be87e

fifteen.c
sixteen.c

index b3285e7..338bdfb 100644 (file)
--- 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));
index 89eef4f..3ea115c 100644 (file)
--- 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));