summaryrefslogtreecommitdiff
path: root/platform/windows/joypad_windows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows/joypad_windows.cpp')
-rw-r--r--platform/windows/joypad_windows.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/platform/windows/joypad_windows.cpp b/platform/windows/joypad_windows.cpp
index da36dc1f2b..94da63e49d 100644
--- a/platform/windows/joypad_windows.cpp
+++ b/platform/windows/joypad_windows.cpp
@@ -330,7 +330,7 @@ void JoypadWindows::process_joypads() {
if (joy.state.dwPacketNumber != joy.last_packet) {
int button_mask = XINPUT_GAMEPAD_DPAD_UP;
for (int j = 0; j <= 16; j++) {
- input->joy_button(joy.id, j, joy.state.Gamepad.wButtons & button_mask);
+ input->joy_button(joy.id, (JoyButton)j, joy.state.Gamepad.wButtons & button_mask);
button_mask = button_mask * 2;
}
@@ -381,12 +381,12 @@ void JoypadWindows::process_joypads() {
for (int j = 0; j < 128; j++) {
if (js.rgbButtons[j] & 0x80) {
if (!joy->last_buttons[j]) {
- input->joy_button(joy->id, j, true);
+ input->joy_button(joy->id, (JoyButton)j, true);
joy->last_buttons[j] = true;
}
} else {
if (joy->last_buttons[j]) {
- input->joy_button(joy->id, j, false);
+ input->joy_button(joy->id, (JoyButton)j, false);
joy->last_buttons[j] = false;
}
}
@@ -400,7 +400,7 @@ void JoypadWindows::process_joypads() {
for (int j = 0; j < joy->joy_axis.size(); j++) {
for (int k = 0; k < count; k++) {
if (joy->joy_axis[j] == axes[k]) {
- input->joy_axis(joy->id, j, axis_correct(values[k]));
+ input->joy_axis(joy->id, (JoyAxis)j, axis_correct(values[k]));
break;
};
};
@@ -410,38 +410,38 @@ void JoypadWindows::process_joypads() {
}
void JoypadWindows::post_hat(int p_device, DWORD p_dpad) {
- int dpad_val = 0;
+ HatMask dpad_val = (HatMask)0;
// Should be -1 when centered, but according to docs:
// "Some drivers report the centered position of the POV indicator as 65,535. Determine whether the indicator is centered as follows:
// BOOL POVCentered = (LOWORD(dwPOV) == 0xFFFF);"
// https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ee416628(v%3Dvs.85)#remarks
if (LOWORD(p_dpad) == 0xFFFF) {
- dpad_val = Input::HAT_MASK_CENTER;
+ dpad_val = (HatMask)HatMask::HAT_MASK_CENTER;
}
if (p_dpad == 0) {
- dpad_val = Input::HAT_MASK_UP;
+ dpad_val = (HatMask)HatMask::HAT_MASK_UP;
} else if (p_dpad == 4500) {
- dpad_val = (Input::HAT_MASK_UP | Input::HAT_MASK_RIGHT);
+ dpad_val = (HatMask)(HatMask::HAT_MASK_UP | HatMask::HAT_MASK_RIGHT);
} else if (p_dpad == 9000) {
- dpad_val = Input::HAT_MASK_RIGHT;
+ dpad_val = (HatMask)HatMask::HAT_MASK_RIGHT;
} else if (p_dpad == 13500) {
- dpad_val = (Input::HAT_MASK_RIGHT | Input::HAT_MASK_DOWN);
+ dpad_val = (HatMask)(HatMask::HAT_MASK_RIGHT | HatMask::HAT_MASK_DOWN);
} else if (p_dpad == 18000) {
- dpad_val = Input::HAT_MASK_DOWN;
+ dpad_val = (HatMask)HatMask::HAT_MASK_DOWN;
} else if (p_dpad == 22500) {
- dpad_val = (Input::HAT_MASK_DOWN | Input::HAT_MASK_LEFT);
+ dpad_val = (HatMask)(HatMask::HAT_MASK_DOWN | HatMask::HAT_MASK_LEFT);
} else if (p_dpad == 27000) {
- dpad_val = Input::HAT_MASK_LEFT;
+ dpad_val = (HatMask)HatMask::HAT_MASK_LEFT;
} else if (p_dpad == 31500) {
- dpad_val = (Input::HAT_MASK_LEFT | Input::HAT_MASK_UP);
+ dpad_val = (HatMask)(HatMask::HAT_MASK_LEFT | HatMask::HAT_MASK_UP);
}
input->joy_hat(p_device, dpad_val);
};