mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Refactor general_write_handler some more
This commit is contained in:
parent
11495183a5
commit
ad5d46bba3
@ -107,6 +107,7 @@ enum basic_event
|
||||
RARCH_CMD_AUDIO_START,
|
||||
RARCH_CMD_OVERLAY_INIT,
|
||||
RARCH_CMD_OVERLAY_DEINIT,
|
||||
RARCH_CMD_OVERLAY_REINIT,
|
||||
RARCH_CMD_DSP_FILTER_INIT,
|
||||
RARCH_CMD_DSP_FILTER_DEINIT,
|
||||
RARCH_CMD_RECORD_INIT,
|
||||
|
@ -3184,6 +3184,10 @@ void rarch_main_command(unsigned action)
|
||||
memset(&driver.overlay_state, 0, sizeof(driver.overlay_state));
|
||||
#endif
|
||||
break;
|
||||
case RARCH_CMD_OVERLAY_REINIT:
|
||||
rarch_main_command(RARCH_CMD_OVERLAY_DEINIT);
|
||||
rarch_main_command(RARCH_CMD_OVERLAY_INIT);
|
||||
break;
|
||||
case RARCH_CMD_DSP_FILTER_INIT:
|
||||
rarch_main_command(RARCH_CMD_DSP_FILTER_DEINIT);
|
||||
if (!*g_settings.audio.dsp_plugin)
|
||||
|
@ -1038,9 +1038,6 @@ static void general_read_handler(const void *data)
|
||||
static void general_write_handler(const void *data)
|
||||
{
|
||||
unsigned rarch_cmd = RARCH_CMD_NONE;
|
||||
bool has_set_overlay_init = false;
|
||||
bool has_set_overlay_free = false;
|
||||
bool has_set_dsp_init = false;
|
||||
bool has_set_libretro_dir = false;
|
||||
const rarch_setting_t *setting = (const rarch_setting_t*)data;
|
||||
|
||||
@ -1205,9 +1202,7 @@ static void general_write_handler(const void *data)
|
||||
else if (!strcmp(setting->name, "input_overlay"))
|
||||
{
|
||||
strlcpy(g_settings.input.overlay, setting->value.string, sizeof(g_settings.input.overlay));
|
||||
|
||||
has_set_overlay_free = true;
|
||||
has_set_overlay_init = true;
|
||||
rarch_cmd = RARCH_CMD_OVERLAY_REINIT;
|
||||
}
|
||||
else if (!strcmp(setting->name, "input_overlay_scale"))
|
||||
{
|
||||
@ -1385,11 +1380,6 @@ static void general_write_handler(const void *data)
|
||||
if (rarch_cmd)
|
||||
rarch_main_command(rarch_cmd);
|
||||
|
||||
if (has_set_overlay_free)
|
||||
rarch_main_command(RARCH_CMD_OVERLAY_DEINIT);
|
||||
if (has_set_overlay_init)
|
||||
rarch_main_command(RARCH_CMD_OVERLAY_INIT);
|
||||
|
||||
if (has_set_libretro_dir)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
|
Loading…
x
Reference in New Issue
Block a user