Create RARCH_CTL_PREINIT

This commit is contained in:
twinaphex 2015-12-07 15:01:53 +01:00
parent c62f6ed26d
commit cad237231e
3 changed files with 11 additions and 13 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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);