mirror of
https://github.com/libretro/RetroArch
synced 2025-02-19 21:40:49 +00:00
Refactor away rarch_main_clear_state
This commit is contained in:
parent
dd9aa6dae2
commit
54c3b60603
@ -1073,7 +1073,7 @@ void rarch_main_alloc(void)
|
||||
|
||||
event_command(EVENT_CMD_HISTORY_DEINIT);
|
||||
|
||||
rarch_main_clear_state();
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_CLEAR_STATE, NULL);
|
||||
rarch_main_data_clear_state();
|
||||
}
|
||||
|
||||
|
14
runloop.c
14
runloop.c
@ -855,21 +855,17 @@ FILE *rarch_main_log_file(void)
|
||||
return global->log_file;
|
||||
}
|
||||
|
||||
void rarch_main_clear_state(void)
|
||||
{
|
||||
driver_clear_state();
|
||||
|
||||
rarch_main_state_free();
|
||||
|
||||
rarch_main_global_free();
|
||||
}
|
||||
|
||||
bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_MAIN_CTL_CLEAR_STATE:
|
||||
driver_clear_state();
|
||||
rarch_main_state_free();
|
||||
rarch_main_global_free();
|
||||
return true;
|
||||
case RARCH_MAIN_CTL_SET_MAX_FRAMES:
|
||||
{
|
||||
unsigned *ptr = (unsigned*)data;
|
||||
|
@ -42,7 +42,8 @@ enum rarch_main_ctl_state
|
||||
RARCH_MAIN_CTL_IS_PAUSED,
|
||||
RARCH_MAIN_CTL_SET_PAUSED,
|
||||
RARCH_MAIN_CTL_SET_MAX_FRAMES,
|
||||
RARCH_MAIN_CTL_SET_FRAME_LIMIT_LAST_TIME
|
||||
RARCH_MAIN_CTL_SET_FRAME_LIMIT_LAST_TIME,
|
||||
RARCH_MAIN_CTL_CLEAR_STATE
|
||||
};
|
||||
|
||||
typedef struct rarch_resolution
|
||||
@ -333,8 +334,6 @@ void rarch_main_msg_queue_free(void);
|
||||
|
||||
void rarch_main_msg_queue_init(void);
|
||||
|
||||
void rarch_main_clear_state(void);
|
||||
|
||||
bool rarch_main_verbosity(void);
|
||||
|
||||
FILE *rarch_main_log_file(void);
|
||||
|
@ -36,7 +36,7 @@ int main(int argc, char *argv[])
|
||||
(argc - optind - 1) * sizeof(char*));
|
||||
argc--;
|
||||
|
||||
rarch_main_clear_state();
|
||||
rarch_main_ctl(RARCH_MAIN_CTL_CLEAR_STATE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user