mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(Emscripten) Simplify input driver's init function
This commit is contained in:
parent
1f7482d833
commit
6630884254
@ -50,18 +50,20 @@ static void *rwebinput_input_init(void)
|
|||||||
{
|
{
|
||||||
rwebinput_input_t *rwebinput = (rwebinput_input_t*)calloc(1, sizeof(*rwebinput));
|
rwebinput_input_t *rwebinput = (rwebinput_input_t*)calloc(1, sizeof(*rwebinput));
|
||||||
if (!rwebinput)
|
if (!rwebinput)
|
||||||
return NULL;
|
goto error;
|
||||||
|
|
||||||
rwebinput->context = RWebInputInit();
|
rwebinput->context = RWebInputInit();
|
||||||
if (!rwebinput->context)
|
if (!rwebinput->context)
|
||||||
{
|
goto error;
|
||||||
free(rwebinput);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
input_keymaps_init_keyboard_lut(rarch_key_map_rwebinput);
|
input_keymaps_init_keyboard_lut(rarch_key_map_rwebinput);
|
||||||
|
|
||||||
return rwebinput;
|
return rwebinput;
|
||||||
|
|
||||||
|
error:
|
||||||
|
if (rwebinput)
|
||||||
|
free(rwebinput);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool rwebinput_key_pressed(rwebinput_input_t *rwebinput, int key)
|
static bool rwebinput_key_pressed(rwebinput_input_t *rwebinput, int key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user