mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 19:21:06 +00:00
Create RARCH_CTL_PREINIT
This commit is contained in:
parent
c62f6ed26d
commit
cad237231e
@ -261,7 +261,7 @@ int rarch_main(int argc, char *argv[], void *data)
|
||||
int ret = 0;
|
||||
settings_t *settings = NULL;
|
||||
|
||||
rarch_main_alloc();
|
||||
rarch_ctl(RARCH_CTL_PREINIT, NULL);
|
||||
|
||||
frontend_driver_init_first(args);
|
||||
rarch_ctl(RARCH_CTL_INIT, NULL);
|
||||
|
18
retroarch.c
18
retroarch.c
@ -1067,16 +1067,6 @@ static bool init_state(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
void rarch_main_alloc(void)
|
||||
{
|
||||
if (!config_realloc())
|
||||
return;
|
||||
|
||||
event_command(EVENT_CMD_HISTORY_DEINIT);
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_CLEAR_STATE, NULL);
|
||||
}
|
||||
|
||||
void rarch_main_free(void)
|
||||
{
|
||||
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_DEINIT, NULL);
|
||||
@ -1315,6 +1305,14 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
event_command(EVENT_CMD_DRIVERS_INIT);
|
||||
}
|
||||
return true;
|
||||
case RARCH_CTL_PREINIT:
|
||||
if (!config_realloc())
|
||||
return false;
|
||||
|
||||
event_command(EVENT_CMD_HISTORY_DEINIT);
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_CLEAR_STATE, NULL);
|
||||
return true;
|
||||
case RARCH_CTL_INIT:
|
||||
rarch_ctl(RARCH_CTL_DEINIT, NULL);
|
||||
init_state();
|
||||
|
@ -61,6 +61,8 @@ enum rarch_ctl_state
|
||||
/* Initialize all drivers. */
|
||||
RARCH_CTL_INIT,
|
||||
|
||||
RARCH_CTL_PREINIT,
|
||||
|
||||
RARCH_CTL_LOAD_CONTENT,
|
||||
|
||||
#ifdef HAVE_FFMPEG
|
||||
@ -148,8 +150,6 @@ struct rarch_main_wrap
|
||||
bool touched;
|
||||
};
|
||||
|
||||
void rarch_main_alloc(void);
|
||||
|
||||
void rarch_main_free(void);
|
||||
|
||||
bool rarch_ctl(enum rarch_ctl_state state, void *data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user