Infrastructure change: game_anim_length and game_flash_length now
[sgt/puzzles] / twiddle.c
index 871bd7f..02b7982 100644 (file)
--- a/twiddle.c
+++ b/twiddle.c
@@ -594,6 +594,8 @@ static game_state *make_move(game_state *from, game_ui *ui, int x, int y,
     game_state *ret;
     int dir;
 
+    button = button & (~MOD_MASK | MOD_NUM_KEYPAD);
+
     if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
        /*
         * Determine the coordinates of the click. We offset by n-1
@@ -940,7 +942,7 @@ static int highlight_colour(float angle)
 }
 
 static float game_anim_length(game_state *oldstate, game_state *newstate,
-                             int dir)
+                             int dir, game_ui *ui)
 {
     if ((dir > 0 && newstate->just_used_solve) ||
        (dir < 0 && oldstate->just_used_solve))
@@ -950,7 +952,7 @@ static float game_anim_length(game_state *oldstate, game_state *newstate,
 }
 
 static float game_flash_length(game_state *oldstate, game_state *newstate,
-                              int dir)
+                              int dir, game_ui *ui)
 {
     if (!oldstate->completed && newstate->completed &&
        !oldstate->used_solve && !newstate->used_solve)
@@ -1010,7 +1012,7 @@ static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
      */
     if (oldstate) {
        float angle;
-       float anim_max = game_anim_length(oldstate, state, dir);
+       float anim_max = game_anim_length(oldstate, state, dir, ui);
 
        if (dir > 0) {
            lastx = state->lastx;