diff options
| author | Simon Tatham <anakin@pobox.com> | 2004-04-30 10:17:22 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2004-04-30 10:17:22 +0000 |
| commit | a3c5409af26b5596c47a48a4b7e706d30da5da24 (patch) | |
| tree | 9927fc9d057868e1ee3755ab496213771b784555 | |
| parent | 17f261018a9721e677cb43c74471f17ac9e3ac6e (diff) | |
| download | puzzles-a3c5409af26b5596c47a48a4b7e706d30da5da24.zip puzzles-a3c5409af26b5596c47a48a4b7e706d30da5da24.tar.gz puzzles-a3c5409af26b5596c47a48a4b7e706d30da5da24.tar.bz2 puzzles-a3c5409af26b5596c47a48a4b7e706d30da5da24.tar.xz | |
Keep the status bar in better sync with the game display.
[originally from svn r4177]
| -rw-r--r-- | fifteen.c | 7 | ||||
| -rw-r--r-- | sixteen.c | 7 |
2 files changed, 14 insertions, 0 deletions
@@ -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)); @@ -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)); |