From 2460b4576b06347355f8ac23a75c92f30005a015 Mon Sep 17 00:00:00 2001 From: Christoph Frick Date: Fri, 7 Jul 2006 10:01:42 +0200 Subject: [PATCH] dinput: map_axis must be able to work with LONG's value range. --- dlls/dinput/joystick_linuxinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 727fac1bbea..c88ac78c4d8 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -664,7 +664,7 @@ map_axis(JoystickImpl* This, int axis, int val) { 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);