Clean-up Input.cpp
This commit is contained in:
parent
57391868f9
commit
c5a8fec289
1 changed files with 3 additions and 3 deletions
|
@ -114,7 +114,7 @@ BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
|
||||||
static int already_ran;
|
static int already_ran;
|
||||||
static DirectInputPair *directinput_objects;
|
static DirectInputPair *directinput_objects;
|
||||||
|
|
||||||
if ((already_ran & 1) == 0)
|
if (!(already_ran & 1))
|
||||||
{
|
{
|
||||||
already_ran |= 1;
|
already_ran |= 1;
|
||||||
directinput_objects = (DirectInputPair*)pvRef;
|
directinput_objects = (DirectInputPair*)pvRef;
|
||||||
|
@ -166,7 +166,7 @@ BOOL GetJoystickStatus(JOYSTICK_STATUS *status)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
HRESULT res = joystick->GetDeviceState(sizeof(DIJOYSTATE), &joystate);
|
HRESULT res = joystick->GetDeviceState(sizeof(DIJOYSTATE), &joystate);
|
||||||
if (res)
|
if (res != DI_OK)
|
||||||
{
|
{
|
||||||
if (res == DIERR_INPUTLOST)
|
if (res == DIERR_INPUTLOST)
|
||||||
SetDeviceAquire(FALSE);
|
SetDeviceAquire(FALSE);
|
||||||
|
@ -211,7 +211,7 @@ BOOL ResetJoystickStatus(void)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
HRESULT res = joystick->GetDeviceState(sizeof(DIJOYSTATE), &joystate);
|
HRESULT res = joystick->GetDeviceState(sizeof(DIJOYSTATE), &joystate);
|
||||||
if (res)
|
if (res != DI_OK)
|
||||||
{
|
{
|
||||||
if (res == DIERR_INPUTLOST)
|
if (res == DIERR_INPUTLOST)
|
||||||
SetDeviceAquire(FALSE);
|
SetDeviceAquire(FALSE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue