[Wii] fixed analog stick(s) support in menu (regression introduced in latest changes to menu inputs polling)

This commit is contained in:
ekeeke 2023-05-20 19:34:37 +02:00
parent a7f42b438e
commit 60f2281fc3
2 changed files with 10 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

@ -1821,12 +1821,12 @@ void gx_input_UpdateMenu(void)
hw = data->btns_h & WPAD_BUTTONS_HELD;
/* WPAD analog sticks (handled as held direction keys) */
x = wpad_StickX(data, i);
y = wpad_StickY(data, i);
if (x > ANALOG_SENSITIVITY) hw |= PAD_BUTTON_RIGHT;
else if (x < -ANALOG_SENSITIVITY) hw |= PAD_BUTTON_LEFT;
else if (y > ANALOG_SENSITIVITY) hw |= PAD_BUTTON_UP;
else if (y < -ANALOG_SENSITIVITY) hw |= PAD_BUTTON_DOWN;
x = wpad_StickX(data, 0);
y = wpad_StickY(data, 0);
if (x > ANALOG_SENSITIVITY) hp |= PAD_BUTTON_RIGHT;
else if (x < -ANALOG_SENSITIVITY) hp |= PAD_BUTTON_LEFT;
else if (y > ANALOG_SENSITIVITY) hp |= PAD_BUTTON_UP;
else if (y < -ANALOG_SENSITIVITY) hp |= PAD_BUTTON_DOWN;
/* Wiimote orientation */
WPAD_IR(i, &m_input.ir);
@ -1849,10 +1849,10 @@ void gx_input_UpdateMenu(void)
hwu = WiiDRC_ButtonsHeld() & WIIU_BUTTONS_HELD;
x = WiiDRC_lStickX();
y = WiiDRC_lStickY();
if (x > ANALOG_SENSITIVITY) hwu |= PAD_BUTTON_RIGHT;
else if (x < -ANALOG_SENSITIVITY) hwu |= PAD_BUTTON_LEFT;
else if (y > ANALOG_SENSITIVITY) hwu |= PAD_BUTTON_UP;
else if (y < -ANALOG_SENSITIVITY) hwu |= PAD_BUTTON_DOWN;
if (x > ANALOG_SENSITIVITY) hp |= PAD_BUTTON_RIGHT;
else if (x < -ANALOG_SENSITIVITY) hp |= PAD_BUTTON_LEFT;
else if (y > ANALOG_SENSITIVITY) hp |= PAD_BUTTON_UP;
else if (y < -ANALOG_SENSITIVITY) hp |= PAD_BUTTON_DOWN;
}
else
{