Christoph Frick : dinput: map_axis must be able to work with LONG' s value range.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jul 7 11:10:08 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 2460b4576b06347355f8ac23a75c92f30005a015
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=2460b4576b06347355f8ac23a75c92f30005a015

Author: Christoph Frick <frick at sc-networks.de>
Date:   Fri Jul  7 10:01:42 2006 +0200

dinput: map_axis must be able to work with LONG's value range.

---

 dlls/dinput/joystick_linuxinput.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index 727fac1..c88ac78 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -664,7 +664,7 @@ map_axis(JoystickImpl* This, int axis, i
     if (xmin == xmax) return val;
 
     /* map the value from the hmin-hmax range into the wmin-wmax range */
-    ret = ((val-hmin) * (wmax-wmin)) / (hmax-hmin) + wmin;
+    ret = MulDiv( val - hmin, wmax - wmin, hmax - hmin ) + wmin;
 
     TRACE("xmin=%d xmax=%d hmin=%d hmax=%d wmin=%d wmax=%d val=%d ret=%d\n", xmin, xmax, hmin, hmax, wmin, wmax, val, ret);
 




More information about the wine-cvs mailing list