mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
(driver.c) Cleanups
This commit is contained in:
parent
7660b67ad4
commit
94c042f686
10
driver.c
10
driver.c
@ -443,6 +443,11 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
|
|||||||
uninit_drivers(*flags);
|
uninit_drivers(*flags);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case RARCH_DRIVER_CTL_UNINIT_ALL:
|
||||||
|
{
|
||||||
|
int flags = DRIVERS_CMD_ALL;
|
||||||
|
return driver_ctl(RARCH_DRIVER_CTL_UNINIT, &flags);
|
||||||
|
}
|
||||||
case RARCH_DRIVER_CTL_INIT:
|
case RARCH_DRIVER_CTL_INIT:
|
||||||
{
|
{
|
||||||
int *flags = (int*)data;
|
int *flags = (int*)data;
|
||||||
@ -451,6 +456,11 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
|
|||||||
init_drivers(*flags);
|
init_drivers(*flags);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case RARCH_DRIVER_CTL_INIT_ALL:
|
||||||
|
{
|
||||||
|
int flags = DRIVERS_CMD_ALL;
|
||||||
|
return driver_ctl(RARCH_DRIVER_CTL_INIT, &flags);
|
||||||
|
}
|
||||||
case RARCH_DRIVER_CTL_INIT_PRE:
|
case RARCH_DRIVER_CTL_INIT_PRE:
|
||||||
audio_driver_ctl(RARCH_AUDIO_CTL_FIND_DRIVER, NULL);
|
audio_driver_ctl(RARCH_AUDIO_CTL_FIND_DRIVER, NULL);
|
||||||
video_driver_ctl(RARCH_DISPLAY_CTL_FIND_DRIVER, NULL);
|
video_driver_ctl(RARCH_DISPLAY_CTL_FIND_DRIVER, NULL);
|
||||||
|
5
driver.h
5
driver.h
@ -172,10 +172,15 @@ enum driver_ctl_state
|
|||||||
* @data is a bitmask which determines
|
* @data is a bitmask which determines
|
||||||
* which drivers get deinitialized. */
|
* which drivers get deinitialized. */
|
||||||
RARCH_DRIVER_CTL_UNINIT,
|
RARCH_DRIVER_CTL_UNINIT,
|
||||||
|
|
||||||
|
RARCH_DRIVER_CTL_UNINIT_ALL,
|
||||||
|
|
||||||
/* Initializes drivers.
|
/* Initializes drivers.
|
||||||
* @data is a bitmask which determines
|
* @data is a bitmask which determines
|
||||||
* which drivers get initialized. */
|
* which drivers get initialized. */
|
||||||
RARCH_DRIVER_CTL_INIT,
|
RARCH_DRIVER_CTL_INIT,
|
||||||
|
|
||||||
|
RARCH_DRIVER_CTL_INIT_ALL,
|
||||||
/* Attempts to find a default driver for
|
/* Attempts to find a default driver for
|
||||||
* all driver types.
|
* all driver types.
|
||||||
*
|
*
|
||||||
|
40
retroarch.c
40
retroarch.c
@ -1224,7 +1224,6 @@ bool rarch_game_options_validate(char *s, size_t len, bool mkdir)
|
|||||||
static int rarch_main_init(int argc, char *argv[])
|
static int rarch_main_init(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int sjlj_ret;
|
int sjlj_ret;
|
||||||
int flags = DRIVERS_CMD_ALL;
|
|
||||||
bool *verbosity = NULL;
|
bool *verbosity = NULL;
|
||||||
|
|
||||||
init_state();
|
init_state();
|
||||||
@ -1305,7 +1304,7 @@ static int rarch_main_init(int argc, char *argv[])
|
|||||||
if (!event_cmd_ctl(EVENT_CMD_CORE_INIT, ¤t_core_type))
|
if (!event_cmd_ctl(EVENT_CMD_CORE_INIT, ¤t_core_type))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
driver_ctl(RARCH_DRIVER_CTL_INIT, &flags);
|
driver_ctl(RARCH_DRIVER_CTL_INIT_ALL, NULL);
|
||||||
event_cmd_ctl(EVENT_CMD_COMMAND_INIT, NULL);
|
event_cmd_ctl(EVENT_CMD_COMMAND_INIT, NULL);
|
||||||
event_cmd_ctl(EVENT_CMD_REMOTE_INIT, NULL);
|
event_cmd_ctl(EVENT_CMD_REMOTE_INIT, NULL);
|
||||||
event_cmd_ctl(EVENT_CMD_REWIND_INIT, NULL);
|
event_cmd_ctl(EVENT_CMD_REWIND_INIT, NULL);
|
||||||
@ -1377,33 +1376,26 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
rarch_is_inited = true;
|
rarch_is_inited = true;
|
||||||
break;
|
break;
|
||||||
case RARCH_CTL_DESTROY:
|
case RARCH_CTL_DESTROY:
|
||||||
{
|
has_set_username = false;
|
||||||
int flags = DRIVERS_CMD_ALL;
|
rarch_is_inited = false;
|
||||||
|
rarch_error_on_init = false;
|
||||||
|
rarch_block_config_read = false;
|
||||||
|
rarch_force_fullscreen = false;
|
||||||
|
|
||||||
has_set_username = false;
|
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL);
|
||||||
rarch_is_inited = false;
|
driver_ctl(RARCH_DRIVER_CTL_UNINIT_ALL, NULL);
|
||||||
rarch_error_on_init = false;
|
event_cmd_ctl(EVENT_CMD_LOG_FILE_DEINIT, NULL);
|
||||||
rarch_block_config_read = false;
|
|
||||||
rarch_force_fullscreen = false;
|
|
||||||
|
|
||||||
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL);
|
runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL);
|
||||||
driver_ctl(RARCH_DRIVER_CTL_UNINIT, &flags);
|
runloop_ctl(RUNLOOP_CTL_GLOBAL_FREE, NULL);
|
||||||
event_cmd_ctl(EVENT_CMD_LOG_FILE_DEINIT, NULL);
|
runloop_ctl(RUNLOOP_CTL_DATA_DEINIT, NULL);
|
||||||
|
config_free();
|
||||||
runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL);
|
|
||||||
runloop_ctl(RUNLOOP_CTL_GLOBAL_FREE, NULL);
|
|
||||||
runloop_ctl(RUNLOOP_CTL_DATA_DEINIT, NULL);
|
|
||||||
config_free();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case RARCH_CTL_DEINIT:
|
case RARCH_CTL_DEINIT:
|
||||||
{
|
if (!rarch_ctl(RARCH_CTL_IS_INITED, NULL))
|
||||||
int flags = DRIVERS_CMD_ALL;
|
return false;
|
||||||
if (!rarch_ctl(RARCH_CTL_IS_INITED, NULL))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
driver_ctl(RARCH_DRIVER_CTL_UNINIT, &flags);
|
driver_ctl(RARCH_DRIVER_CTL_UNINIT_ALL, NULL);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case RARCH_CTL_PREINIT:
|
case RARCH_CTL_PREINIT:
|
||||||
if (!config_realloc())
|
if (!config_realloc())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user