From 35aef696ea9f53efc8797bc647e6dc0bccae5a92 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 21 Nov 2015 09:54:55 +0100 Subject: [PATCH] Add RARCH_DISPLAY_CTL_DEFAULT_SETTINGS --- configuration.c | 4 ++-- gfx/video_driver.c | 15 +++++++++++++++ gfx/video_driver.h | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/configuration.c b/configuration.c index 20f3c30c87..dd1621d3ff 100644 --- a/configuration.c +++ b/configuration.c @@ -715,11 +715,11 @@ static void config_set_defaults(void) global->console.sound.system_bgm_enable = false; #ifdef RARCH_CONSOLE - global->console.screen.gamma_correction = DEFAULT_GAMMA; - global->console.screen.resolutions.current.id = 0; global->console.sound.mode = SOUND_MODE_NORMAL; #endif + video_driver_ctl(RARCH_DISPLAY_CTL_DEFAULT_SETTINGS, NULL); + if (*g_defaults.path.buildbot_server_url) strlcpy(settings->network.buildbot_url, g_defaults.path.buildbot_server_url, sizeof(settings->network.buildbot_url)); diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 1075f6f74c..1a7d36355f 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -22,6 +22,7 @@ #include "video_pixel_converter.h" #include "video_context_driver.h" #include "video_monitor.h" +#include "../config.def.h" #include "../general.h" #include "../performance.h" #include "../string_list_special.h" @@ -1214,6 +1215,20 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data) return false; case RARCH_DISPLAY_CTL_FRAME_FILTER_IS_32BIT: return video_state.filter.out_rgb32; + case RARCH_DISPLAY_CTL_DEFAULT_SETTINGS: + { + global_t *global = global_get_ptr(); + + if (!global) + return false; + + global->console.screen.gamma_correction = DEFAULT_GAMMA; + global->console.flickerfilter_enable = false; + global->console.softfilter_enable = false; + + global->console.screen.resolutions.current.id = 0; + } + return true; case RARCH_DISPLAY_CTL_LOAD_SETTINGS: { global_t *global = global_get_ptr(); diff --git a/gfx/video_driver.h b/gfx/video_driver.h index d8bc35dcbc..6aa618dc92 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -223,6 +223,7 @@ enum rarch_display_ctl_state RARCH_DISPLAY_CTL_NONE = 0, RARCH_DISPLAY_CTL_INIT, RARCH_DISPLAY_CTL_DEINIT, + RARCH_DISPLAY_CTL_DEFAULT_SETTINGS, RARCH_DISPLAY_CTL_LOAD_SETTINGS, RARCH_DISPLAY_CTL_SAVE_SETTINGS, RARCH_DISPLAY_CTL_MONITOR_RESET,