Add a `jumble' key (`J') to Net, which scrambles the positions of all unlocked
[sgt/puzzles] / sixteen.c
index 1e865c2..f6215bd 100644 (file)
--- a/sixteen.c
+++ b/sixteen.c
@@ -575,7 +575,7 @@ static void draw_arrow(frontend *fe, int x, int y, int xdx, int xdy)
 }
 
 void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
-                 game_state *state, game_ui *ui,
+                 game_state *state, int dir, game_ui *ui,
                  float animtime, float flashtime)
 {
     int i, bgcolour;
@@ -664,10 +664,12 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
                float c;
                int sense;
 
-               if (oldstate && state->movecount < oldstate->movecount)
+               if (dir < 0) {
+                   assert(oldstate);
                    sense = -oldstate->last_movement_sense;
-               else
+               } else {
                    sense = state->last_movement_sense;
+               }
 
                t = state->tiles[i];
 
@@ -750,12 +752,12 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
     }
 }
 
-float game_anim_length(game_state *oldstate, game_state *newstate)
+float game_anim_length(game_state *oldstate, game_state *newstate, int dir)
 {
     return ANIM_TIME;
 }
 
-float game_flash_length(game_state *oldstate, game_state *newstate)
+float game_flash_length(game_state *oldstate, game_state *newstate, int dir)
 {
     if (!oldstate->completed && newstate->completed)
         return 2 * FLASH_FRAME;