mirror of
https://github.com/libretro/RetroArch
synced 2025-03-20 19:21:27 +00:00
Cleanups
This commit is contained in:
parent
d0af46d460
commit
826fbf6bdf
@ -111,13 +111,9 @@ bool dinput_init_context(void)
|
|||||||
&IID_IDirectInput8,
|
&IID_IDirectInput8,
|
||||||
(void**)&g_dinput_ctx, NULL))))
|
(void**)&g_dinput_ctx, NULL))))
|
||||||
#endif
|
#endif
|
||||||
goto error;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
error:
|
|
||||||
RARCH_ERR("[DINPUT]: Failed to initialize DirectInput.\n");
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *dinput_init(const char *joypad_driver)
|
static void *dinput_init(const char *joypad_driver)
|
||||||
@ -125,10 +121,7 @@ static void *dinput_init(const char *joypad_driver)
|
|||||||
struct dinput_input *di = NULL;
|
struct dinput_input *di = NULL;
|
||||||
|
|
||||||
if (!dinput_init_context())
|
if (!dinput_init_context())
|
||||||
{
|
|
||||||
RARCH_ERR("[DINPUT]: Failed to start DirectInput driver.\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
di = (struct dinput_input*)calloc(1, sizeof(*di));
|
di = (struct dinput_input*)calloc(1, sizeof(*di));
|
||||||
if (!di)
|
if (!di)
|
||||||
@ -147,7 +140,6 @@ static void *dinput_init(const char *joypad_driver)
|
|||||||
&di->keyboard, NULL)))
|
&di->keyboard, NULL)))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
RARCH_ERR("[DINPUT]: Failed to create keyboard device.\n");
|
|
||||||
di->keyboard = NULL;
|
di->keyboard = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +153,6 @@ static void *dinput_init(const char *joypad_driver)
|
|||||||
&di->mouse, NULL)))
|
&di->mouse, NULL)))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
RARCH_ERR("[DINPUT]: Failed to create mouse device.\n");
|
|
||||||
di->mouse = NULL;
|
di->mouse = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -858,10 +849,7 @@ bool dinput_handle_message(void *data,
|
|||||||
(struct pointer_status *)malloc(sizeof(struct pointer_status));
|
(struct pointer_status *)malloc(sizeof(struct pointer_status));
|
||||||
|
|
||||||
if (!new_pointer)
|
if (!new_pointer)
|
||||||
{
|
|
||||||
RARCH_ERR("[DINPUT]: dinput_handle_message: pointer allocation in WM_POINTERDOWN failed.\n");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
new_pointer->pointer_id = GET_POINTERID_WPARAM(wParam);
|
new_pointer->pointer_id = GET_POINTERID_WPARAM(wParam);
|
||||||
dinput_pointer_store_pos(new_pointer, lParam);
|
dinput_pointer_store_pos(new_pointer, lParam);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user