Input.cpp corrections
Typical Microsoft: make the return type a BOOL, but the make the actual values some random enum.
This commit is contained in:
parent
6764f17ab9
commit
d50c012446
1 changed files with 8 additions and 7 deletions
|
@ -70,14 +70,15 @@ BOOL InitDirectInput(HINSTANCE hinst, HWND hWnd)
|
||||||
#endif
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!HookAllDirectInputDevices(hWnd))
|
if (!HookDirectInputDevice(hWnd))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The original name for this function and its variables are unknown
|
// The original name for this function and its variables are unknown.
|
||||||
BOOL HookAllDirectInputDevices(HWND hWnd)
|
// This function finds and hooks the first available DirectInput device.
|
||||||
|
BOOL HookDirectInputDevice(HWND hWnd)
|
||||||
{
|
{
|
||||||
DirectInputPair directinput_objects;
|
DirectInputPair directinput_objects;
|
||||||
|
|
||||||
|
@ -110,7 +111,7 @@ BOOL HookAllDirectInputDevices(HWND hWnd)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The original name for this function and its variables are unknown
|
// The original names for this function and its variables are unknown
|
||||||
BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
|
BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
|
||||||
{
|
{
|
||||||
static int already_ran;
|
static int already_ran;
|
||||||
|
@ -126,7 +127,7 @@ BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
|
||||||
if (directinput_objects->lpDI->CreateDevice(lpddi->guidInstance, &device, NULL) != DI_OK)
|
if (directinput_objects->lpDI->CreateDevice(lpddi->guidInstance, &device, NULL) != DI_OK)
|
||||||
{
|
{
|
||||||
directinput_objects->device = NULL;
|
directinput_objects->device = NULL;
|
||||||
return TRUE;
|
return DIENUM_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPDIRECTINPUTDEVICE2A _joystick;
|
static LPDIRECTINPUTDEVICE2A _joystick;
|
||||||
|
@ -135,7 +136,7 @@ BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
|
||||||
if (FAILED(res))
|
if (FAILED(res))
|
||||||
{
|
{
|
||||||
joystick = NULL;
|
joystick = NULL;
|
||||||
return TRUE;
|
return DIENUM_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device != NULL)
|
if (device != NULL)
|
||||||
|
@ -154,7 +155,7 @@ BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
|
||||||
#endif
|
#endif
|
||||||
OutputDebugStringA(string);
|
OutputDebugStringA(string);
|
||||||
|
|
||||||
return FALSE;
|
return DIENUM_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL GetJoystickStatus(JOYSTICK_STATUS *status)
|
BOOL GetJoystickStatus(JOYSTICK_STATUS *status)
|
||||||
|
|
Loading…
Add table
Reference in a new issue