summaryrefslogtreecommitdiffhomepage
path: root/StarsEx
diff options
context:
space:
mode:
Diffstat (limited to 'StarsEx')
-rw-r--r--StarsEx/Joystick.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/StarsEx/Joystick.cpp b/StarsEx/Joystick.cpp
index 6881547..8679c10 100644
--- a/StarsEx/Joystick.cpp
+++ b/StarsEx/Joystick.cpp
@@ -465,26 +465,25 @@ Joystick::ReadAxisMM(int a)
return 0;
double result = 0;
-
switch (map_axis[a]) {
case KEY_JOY_AXIS_X:
if (joyinfo.dwFlags & JOY_RETURNX)
- result = joyinfo.dwXpos - 32768;
+ result = static_cast<double>(joyinfo.dwXpos) - 32768.0;
break;
case KEY_JOY_AXIS_Y:
if (joyinfo.dwFlags & JOY_RETURNY)
- result = joyinfo.dwYpos - 32768;
+ result = static_cast<double>(joyinfo.dwYpos) - 32768.0;
break;
case KEY_JOY_AXIS_Z:
if (joyinfo.dwFlags & JOY_RETURNZ)
- result = joyinfo.dwZpos - 32768;
+ result = static_cast<double>(joyinfo.dwZpos) - 32768.0;
break;
case KEY_JOY_AXIS_RZ:
if (joyinfo.dwFlags & JOY_RETURNR)
- result = joyinfo.dwRpos - 32768;
+ result = static_cast<double>(joyinfo.dwRpos) - 32768.0;
break;
}