mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
Split up rarch_main_clear_state into two functions - rarch_main_state_new
and rarch_main_state_free
This commit is contained in:
parent
ec9a217090
commit
9daad8bdb8
@ -121,7 +121,7 @@ void main_exit(args_type() args)
|
||||
driver.frontend_ctx->exitspawn(g_settings.libretro,
|
||||
sizeof(g_settings.libretro));
|
||||
|
||||
rarch_main_clear_state();
|
||||
rarch_main_state_free();
|
||||
|
||||
if (driver.frontend_ctx && driver.frontend_ctx->shutdown)
|
||||
driver.frontend_ctx->shutdown(false);
|
||||
@ -225,7 +225,7 @@ returntype main_entry(signature())
|
||||
if (driver.frontend_ctx && driver.frontend_ctx->init)
|
||||
driver.frontend_ctx->init(args);
|
||||
|
||||
rarch_main_clear_state();
|
||||
rarch_main_state_new();
|
||||
|
||||
if (driver.frontend_ctx)
|
||||
{
|
||||
|
@ -800,7 +800,10 @@ bool config_read_keybinds(const char *path);
|
||||
|
||||
void rarch_deinit_recording(void);
|
||||
bool rarch_audio_flush(const int16_t *data, size_t samples);
|
||||
void rarch_main_clear_state(void);
|
||||
|
||||
void rarch_main_state_new(void);
|
||||
void rarch_main_state_free(void);
|
||||
|
||||
int rarch_main(int argc, char *argv[]);
|
||||
bool rarch_replace_config(const char *path);
|
||||
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
|
||||
|
22
retroarch.c
22
retroarch.c
@ -2525,15 +2525,12 @@ static void deinit_log_file(void)
|
||||
g_extern.log_file = NULL;
|
||||
}
|
||||
|
||||
void rarch_main_clear_state(void)
|
||||
static void main_clear_state(bool inited)
|
||||
{
|
||||
static bool inited = false;
|
||||
unsigned i;
|
||||
|
||||
memset(&g_settings, 0, sizeof(g_settings));
|
||||
|
||||
deinit_log_file();
|
||||
|
||||
if (inited)
|
||||
uninit_drivers();
|
||||
|
||||
@ -2555,11 +2552,28 @@ void rarch_main_clear_state(void)
|
||||
for (i = 0; i < MAX_PLAYERS; i++)
|
||||
g_settings.input.libretro_device[i] = RETRO_DEVICE_JOYPAD;
|
||||
|
||||
}
|
||||
|
||||
void rarch_main_state_new(void)
|
||||
{
|
||||
static bool inited = false;
|
||||
|
||||
main_clear_state(inited);
|
||||
|
||||
init_msg_queue();
|
||||
|
||||
inited = true;
|
||||
}
|
||||
|
||||
void rarch_main_state_free(void)
|
||||
{
|
||||
deinit_log_file();
|
||||
|
||||
main_clear_state(false);
|
||||
|
||||
rarch_deinit_msg_queue();
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#define DEFAULT_EXT "zip"
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user