chiark / gitweb /
Keep the status bar in better sync with the game display.
authorSimon Tatham <anakin@pobox.com>
Fri, 30 Apr 2004 10:17:22 +0000 (10:17 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 30 Apr 2004 10:17:22 +0000 (10:17 +0000)
[originally from svn r4177]

fifteen.c
sixteen.c

index b3285e7a77b60ce6cea0f7c3112b491ba133ec09..338bdfb77480a95734d12603ff2d5428735d150a 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 89eef4f08a53cb654bfce1bbc70555689250ab9c..3ea115c2dacd879d7c8c1549e33d59671e293e27 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));