(dinput) Buildfix

This commit is contained in:
twinaphex 2019-07-04 14:02:24 +02:00
parent 650c0e7e0a
commit ff0ea2921f

View File

@ -328,10 +328,19 @@ static bool dinput_is_pressed(struct dinput_input *di,
if (binds && binds[id].valid)
{
if (dinput_mouse_button_pressed(di, port, bind->mbutton))
return true;
if (input_joypad_pressed(di->joypad, joypad_info, port, binds, id))
return true;
/* Auto-binds are per joypad, not per user. */
const uint16_t joykey = (binds[id].joykey != NO_BTN)
? binds[id].joykey : joypad_info.auto_binds[id].joykey;
const uint32_t joyaxis = (binds[id].joyaxis != AXIS_NONE)
? binds[id].joyaxis : joypad_info.auto_binds[id].joyaxis;
if (dinput_mouse_button_pressed(di, port, binds[id].mbutton))
return true;
if (joykey != NO_BTN
&& di->joypad->button(joypad_info.joy_idx, joykey))
return true;
if (((float)abs(di->joypad->axis(joypad_info.joy_idx, joyaxis)) / 0x8000) > joypad_info.axis_threshold)
return true;
}
return false;