[mupen64plus-input-sdl] 164/196: fall back to key/joy mappings for a controller with mouse=true when the mouse is not grabbed
Sven Eckelmann
ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:00:38 UTC 2015
This is an automated email from the git hooks/post-receive script.
ecsv-guest pushed a commit to branch master
in repository mupen64plus-input-sdl.
commit 8054110e42dc9594e9ba06ba4ba00d76f1efd6c8
Author: Sven Eckelmann <sven at narfation.org>
Date: Fri Dec 13 17:17:08 2013 +0100
fall back to key/joy mappings for a controller with mouse=true when the mouse is not grabbed
---
debian/changelog | 2 ++
debian/patches/fallback_nomousegrab.patch | 51 +++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 54 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index cfc45d1..2c4acfb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ mupen64plus-input-sdl (2.0-3) UNRELEASED; urgency=low
clone
- Add autoconfig_nintendo_wii_remote_pro.patch, Add support for Nintendo
Wii Remote Pro Controller
+ - Add fallback_nomousegrab.patch, fall back to key/joy mappings for a
+ controller with mouse=true when the mouse is not grabbed
* Upgraded to policy 3.9.5, no changes required
-- Sven Eckelmann <sven at narfation.org> Fri, 06 Sep 2013 15:41:35 +0200
diff --git a/debian/patches/fallback_nomousegrab.patch b/debian/patches/fallback_nomousegrab.patch
new file mode 100644
index 0000000..6559249
--- /dev/null
+++ b/debian/patches/fallback_nomousegrab.patch
@@ -0,0 +1,51 @@
+Description: fall back to key/joy mappings for a controller with mouse=true when the mouse is not grabbed
+Author: Richard Goedeken<Richard at 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
diff --git a/debian/patches/series b/debian/patches/series
index 3275cd4..d899267 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ autoconfig_xbox360_refined.patch
autoconfig_sidewinder_gamepad_pro.patch
autoconfig_retrolink_n64.patch
autoconfig_nintendo_wii_remote_pro.patch
+fallback_nomousegrab.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-input-sdl.git
More information about the Pkg-games-commits
mailing list