Refactor rarch_set_fullscreen calls to rarch_main_command

This commit is contained in:
twinaphex 2014-08-02 03:56:19 +02:00
parent c201a546a3
commit d70693345c
6 changed files with 16 additions and 12 deletions

View File

@ -501,7 +501,8 @@ retro_proc_address_t driver_get_proc_address(const char *sym)
bool driver_update_system_av_info(const struct retro_system_av_info *info) bool driver_update_system_av_info(const struct retro_system_av_info *info)
{ {
g_extern.system.av_info = *info; g_extern.system.av_info = *info;
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
// Cannot continue recording with different parameters. // Cannot continue recording with different parameters.
// Take the easiest route out and just restart the recording. // Take the easiest route out and just restart the recording.
#ifdef HAVE_RECORD #ifdef HAVE_RECORD

View File

@ -2574,7 +2574,7 @@ static int menu_common_iterate(unsigned action)
else if (menu_type == MENU_SETTINGS_VIDEO_SOFTFILTER) else if (menu_type == MENU_SETTINGS_VIDEO_SOFTFILTER)
{ {
fill_pathname_join(g_settings.video.filter_path, dir, path, sizeof(g_settings.video.filter_path)); fill_pathname_join(g_settings.video.filter_path, dir, path, sizeof(g_settings.video.filter_path));
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
menu_flush_stack_type(MENU_SETTINGS_VIDEO_OPTIONS); menu_flush_stack_type(MENU_SETTINGS_VIDEO_OPTIONS);
} }
else if (menu_type == MENU_SETTINGS_AUDIO_DSP_FILTER) else if (menu_type == MENU_SETTINGS_AUDIO_DSP_FILTER)
@ -3743,7 +3743,7 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
case MENU_ACTION_OK: case MENU_ACTION_OK:
#ifdef HAVE_FILTERS_BUILTIN #ifdef HAVE_FILTERS_BUILTIN
driver.menu_data_own = true; driver.menu_data_own = true;
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
#elif defined(HAVE_DYLIB) #elif defined(HAVE_DYLIB)
file_list_push(driver.menu->menu_stack, g_settings.video.filter_dir, setting, driver.menu->selection_ptr); file_list_push(driver.menu->menu_stack, g_settings.video.filter_dir, setting, driver.menu->selection_ptr);
menu_clear_navigation(driver.menu); menu_clear_navigation(driver.menu);
@ -3757,7 +3757,7 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
strlcpy(g_settings.video.filter_path, "", sizeof(g_settings.video.filter_path)); strlcpy(g_settings.video.filter_path, "", sizeof(g_settings.video.filter_path));
#endif #endif
driver.menu_data_own = true; driver.menu_data_own = true;
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
break; break;
} }
break; break;
@ -4227,7 +4227,7 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE); g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
} }
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
} }
break; break;
case MENU_SETTINGS_VIDEO_PAL60: case MENU_SETTINGS_VIDEO_PAL60:
@ -4243,7 +4243,7 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
else else
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE); g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
} }
break; break;
case MENU_ACTION_START: case MENU_ACTION_START:
@ -4251,7 +4251,7 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
{ {
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE); g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
} }
break; break;
} }

View File

@ -75,7 +75,7 @@ void engine_handle_cmd(void *data)
slock_unlock(android_app->mutex); slock_unlock(android_app->mutex);
if (g_extern.is_paused) if (g_extern.is_paused)
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
break; break;
case APP_CMD_RESUME: case APP_CMD_RESUME:

View File

@ -99,6 +99,7 @@ enum basic_event
RARCH_CMD_TAKE_SCREENSHOT, RARCH_CMD_TAKE_SCREENSHOT,
RARCH_CMD_PREPARE_DUMMY, RARCH_CMD_PREPARE_DUMMY,
RARCH_CMD_QUIT, RARCH_CMD_QUIT,
RARCH_CMD_REINIT,
}; };
enum menu_enums enum menu_enums
@ -781,7 +782,6 @@ void rarch_check_overlay(void);
void rarch_check_block_hotkey(void); void rarch_check_block_hotkey(void);
void rarch_init_rewind(void); void rarch_init_rewind(void);
void rarch_deinit_rewind(void); void rarch_deinit_rewind(void);
void rarch_set_fullscreen(bool fullscreen);
bool rarch_check_fullscreen(void); bool rarch_check_fullscreen(void);
void rarch_disk_control_set_eject(bool state, bool log); void rarch_disk_control_set_eject(bool state, bool log);
void rarch_disk_control_set_index(unsigned index); void rarch_disk_control_set_index(unsigned index);

View File

@ -2014,7 +2014,7 @@ static void check_savestates(bool immutable)
} }
} }
void rarch_set_fullscreen(bool fullscreen) static void rarch_set_fullscreen(bool fullscreen)
{ {
g_settings.video.fullscreen = fullscreen; g_settings.video.fullscreen = fullscreen;
driver.video_cache_context = g_extern.system.hw_render_callback.cache_context; driver.video_cache_context = g_extern.system.hw_render_callback.cache_context;
@ -2038,7 +2038,7 @@ bool rarch_check_fullscreen(void)
if (toggle) if (toggle)
{ {
g_settings.video.fullscreen = !g_settings.video.fullscreen; g_settings.video.fullscreen = !g_settings.video.fullscreen;
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
} }
was_pressed = pressed; was_pressed = pressed;
@ -3143,6 +3143,9 @@ void rarch_main_command(unsigned action)
case RARCH_CMD_QUIT: case RARCH_CMD_QUIT:
g_extern.system.shutdown = true; g_extern.system.shutdown = true;
break; break;
case RARCH_CMD_REINIT:
rarch_set_fullscreen(g_settings.video.fullscreen);
break;
} }
} }

View File

@ -1340,7 +1340,7 @@ static void general_write_handler(const void *data)
g_settings.user_language = *setting->value.unsigned_integer; g_settings.user_language = *setting->value.unsigned_integer;
if (has_set_reinit) if (has_set_reinit)
rarch_set_fullscreen(g_settings.video.fullscreen); rarch_main_command(RARCH_CMD_REINIT);
} }
#define NEXT (list[index++]) #define NEXT (list[index++])