Clean-up Input.cpp

This commit is contained in:
Clownacy 2019-11-15 18:44:59 +00:00
parent 57391868f9
commit c5a8fec289

View file

@ -114,7 +114,7 @@ BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
static int already_ran;
static DirectInputPair *directinput_objects;
if ((already_ran & 1) == 0)
if (!(already_ran & 1))
{
already_ran |= 1;
directinput_objects = (DirectInputPair*)pvRef;
@ -166,7 +166,7 @@ BOOL GetJoystickStatus(JOYSTICK_STATUS *status)
return FALSE;
HRESULT res = joystick->GetDeviceState(sizeof(DIJOYSTATE), &joystate);
if (res)
if (res != DI_OK)
{
if (res == DIERR_INPUTLOST)
SetDeviceAquire(FALSE);
@ -211,7 +211,7 @@ BOOL ResetJoystickStatus(void)
return FALSE;
HRESULT res = joystick->GetDeviceState(sizeof(DIJOYSTATE), &joystate);
if (res)
if (res != DI_OK)
{
if (res == DIERR_INPUTLOST)
SetDeviceAquire(FALSE);