mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-05-31 16:20:22 +00:00
RAWINPUT_RegisterNotifications() should return int, for consistency
(cherry picked from commit 1903d7b1bf6c73ef23e4d6934c9fec5246dd0b2e)
This commit is contained in:
parent
34c5bde355
commit
e8b6edd5a0
|
@ -2045,13 +2045,13 @@ static void RAWINPUT_JoystickClose(SDL_Joystick *joystick)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_bool RAWINPUT_RegisterNotifications(HWND hWnd)
|
int RAWINPUT_RegisterNotifications(HWND hWnd)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)];
|
RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)];
|
||||||
|
|
||||||
if (!SDL_RAWINPUT_inited) {
|
if (!SDL_RAWINPUT_inited) {
|
||||||
return SDL_TRUE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < SDL_arraysize(subscribed_devices); i++) {
|
for (i = 0; i < SDL_arraysize(subscribed_devices); i++) {
|
||||||
|
@ -2062,19 +2062,18 @@ SDL_bool RAWINPUT_RegisterNotifications(HWND hWnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RegisterRawInputDevices(rid, SDL_arraysize(rid), sizeof(RAWINPUTDEVICE))) {
|
if (!RegisterRawInputDevices(rid, SDL_arraysize(rid), sizeof(RAWINPUTDEVICE))) {
|
||||||
SDL_SetError("Couldn't register for raw input events");
|
return SDL_SetError("Couldn't register for raw input events");
|
||||||
return SDL_FALSE;
|
|
||||||
}
|
}
|
||||||
return SDL_TRUE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RAWINPUT_UnregisterNotifications()
|
int RAWINPUT_UnregisterNotifications()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)];
|
RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)];
|
||||||
|
|
||||||
if (!SDL_RAWINPUT_inited) {
|
if (!SDL_RAWINPUT_inited) {
|
||||||
return SDL_TRUE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < SDL_arraysize(subscribed_devices); i++) {
|
for (i = 0; i < SDL_arraysize(subscribed_devices); i++) {
|
||||||
|
@ -2085,9 +2084,9 @@ void RAWINPUT_UnregisterNotifications()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RegisterRawInputDevices(rid, SDL_arraysize(rid), sizeof(RAWINPUTDEVICE))) {
|
if (!RegisterRawInputDevices(rid, SDL_arraysize(rid), sizeof(RAWINPUTDEVICE))) {
|
||||||
SDL_SetError("Couldn't unregister for raw input events");
|
return SDL_SetError("Couldn't unregister for raw input events");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK
|
LRESULT CALLBACK
|
||||||
|
|
|
@ -28,8 +28,8 @@ extern SDL_bool RAWINPUT_IsEnabled();
|
||||||
extern SDL_bool RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name);
|
extern SDL_bool RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name);
|
||||||
|
|
||||||
/* Registers for input events */
|
/* Registers for input events */
|
||||||
extern SDL_bool RAWINPUT_RegisterNotifications(HWND hWnd);
|
extern int RAWINPUT_RegisterNotifications(HWND hWnd);
|
||||||
extern void RAWINPUT_UnregisterNotifications();
|
extern int RAWINPUT_UnregisterNotifications();
|
||||||
|
|
||||||
/* Returns 0 if message was handled */
|
/* Returns 0 if message was handled */
|
||||||
extern LRESULT CALLBACK RAWINPUT_WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
extern LRESULT CALLBACK RAWINPUT_WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
Loading…
Reference in a new issue