Package: mupen64plus-input-sdl / 2.0-4

fallback_nomousegrab.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Description: fall back to key/joy mappings for a controller with mouse=true when the mouse is not grabbed
Author: Richard Goedeken<Richard@fascinationsoftware.com>

---
diff --git a/src/plugin.c b/src/plugin.c
index c7c4e76b23901b49354a5f66c0572ddd6f532c11..759c24f4abc0450205cbf7dde9bb222ef501a18b 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -612,27 +612,27 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
                 }
 #endif
             }
+            axis_val = mousex_residual;
+            if (axis_val < -80)
+                axis_val = -80;
+            else if (axis_val > 80)
+                axis_val = 80;
+            controller[Control].buttons.X_AXIS = axis_val;
+            axis_val = mousey_residual;
+            if (axis_val < -80)
+                axis_val = -80;
+            else if (axis_val > 80)
+                axis_val = 80;
+            controller[Control].buttons.Y_AXIS = -axis_val;
+            /* the mouse x/y values decay exponentially */
+            mousex_residual = (mousex_residual * 224) / 256;
+            mousey_residual = (mousey_residual * 224) / 256;
         }
         else
         {
             mousex_residual = 0;
             mousey_residual = 0;
         }
-        axis_val = mousex_residual;
-        if (axis_val < -80)
-            axis_val = -80;
-        else if (axis_val > 80)
-            axis_val = 80;
-        controller[Control].buttons.X_AXIS = axis_val;
-        axis_val = mousey_residual;
-        if (axis_val < -80)
-            axis_val = -80;
-        else if (axis_val > 80)
-            axis_val = 80;
-        controller[Control].buttons.Y_AXIS = -axis_val;
-        /* the mouse x/y values decay exponentially */
-        mousex_residual = (mousex_residual * 224) / 256;
-        mousey_residual = (mousey_residual * 224) / 256;
     }
 
 #ifdef _DEBUG