From 193f90a68f6e79a9f11c3ca99854d841c6165911 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 11 Jan 2013 08:38:02 +0100 Subject: [PATCH] (RARCH_CONSOLE) Clean up config_set_defaults somewhat --- config.def.h | 27 +++++++++++++++++++++++++-- settings.c | 24 +----------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/config.def.h b/config.def.h index 09687d40f4..8da7d7fa68 100644 --- a/config.def.h +++ b/config.def.h @@ -161,6 +161,25 @@ enum #define INPUT_DEFAULT_DRIVER INPUT_NULL #endif +#if defined(XENON) || defined(_XBOX360) || defined(__CELLOS_LV2__) +#define DEFAULT_ASPECT_RATIO 1.7778f +#elif defined(_XBOX1) || defined(GEKKO) || defined(ANDROID) +#define DEFAULT_ASPECT_RATIO 1.3333f +#else +#define DEFAULT_ASPECT_RATIO -1.0f +#endif + +#if defined(_XBOX360) +#define DEFAULT_SHADER_TYPE RARCH_SHADER_HLSL +#elif defined(__PSL1GHT__) +#define DEFAULT_SHADER_TYPE RARCH_SHADER_GLSL +#elif defined(__CELLOS_LV2__) +#define DEFAULT_SHADER_TYPE RARCH_SHADER_CG +#elif defined(ANDROID) +#define DEFAULT_SHADER_TYPE RARCH_SHADER_GLSL +#else +#define DEFAULT_SHADER_TYPE RARCH_SHADER_AUTO +#endif //////////////// // Video @@ -190,7 +209,7 @@ static const bool video_smooth = true; static const bool force_aspect = true; // Controls aspect ratio handling. -static const float aspect_ratio = -1.0; // Automatic +static const float aspect_ratio = DEFAULT_ASPECT_RATIO; // Automatic static const bool aspect_ratio_auto = false; // 1:1 PAR // Crop overscanned frames (7/8 or 15/15 for interlaced frames). @@ -209,7 +228,11 @@ static const float message_pos_offset_y = 0.05; static const uint32_t message_color = 0xffff00; // RGB hex value. // Render-to-texture before rendering to screen (multi-pass shaders) +#if defined(__CELLOS_LV2__) || defined(_XBOX360) +static const bool render_to_texture = true; +#else static const bool render_to_texture = false; +#endif static const float fbo_scale_x = 2.0; static const float fbo_scale_y = 2.0; static const bool second_pass_smooth = true; @@ -234,7 +257,7 @@ static const bool font_enable = true; // This value should stay close to 60Hz to avoid large pitch changes. // If your monitor does not run at 60Hz, or something close to it, disable VSync, // and leave this at its default. -#if defined(__CELLOS_LV2__) || defined(XENON) || defined(GEKKO) +#if defined(RARCH_CONSOLE) static const float refresh_rate = 59.92; #else static const float refresh_rate = 59.95; diff --git a/settings.c b/settings.c index f3529a6236..903aa2ed5f 100644 --- a/settings.c +++ b/settings.c @@ -164,7 +164,7 @@ void config_set_defaults(void) g_settings.video.crop_overscan = crop_overscan; g_settings.video.aspect_ratio = aspect_ratio; g_settings.video.aspect_ratio_auto = aspect_ratio_auto; // Let implementation decide if automatic, or 1:1 PAR. - g_settings.video.shader_type = RARCH_SHADER_AUTO; + g_settings.video.shader_type = DEFAULT_SHADER_TYPE; g_settings.video.allow_rotate = allow_rotate; g_settings.video.font_enable = font_enable; @@ -246,29 +246,8 @@ void config_set_defaults(void) #if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL) strlcpy(g_settings.video.cg_shader_path, default_paths.shader_file, sizeof(g_settings.video.cg_shader_path)); strlcpy(g_settings.video.second_pass_shader, default_paths.shader_file, sizeof(g_settings.video.second_pass_shader)); - g_settings.video.second_pass_smooth = true; #endif -#if defined(_XBOX360) - g_settings.video.shader_type = RARCH_SHADER_HLSL; -#elif defined(__PSL1GHT__) - g_settings.video.shader_type = RARCH_SHADER_GLSL; -#elif defined(__CELLOS_LV2__) - g_settings.video.shader_type = RARCH_SHADER_CG; -#elif defined(HAVE_GLSL) - g_settings.video.shader_type = RARCH_SHADER_GLSL; -#else - g_settings.video.shader_type = RARCH_SHADER_NONE; -#endif - -#ifdef GEKKO - g_settings.audio.rate_control_delta = 0.006; - g_settings.audio.rate_control = true; -#endif - - g_settings.video.render_to_texture = true; - g_settings.video.refresh_rate = 59.92; - strlcpy(g_settings.system_directory, default_paths.system_dir, sizeof(g_settings.system_directory)); g_settings.video.msg_pos_x = 0.05f; @@ -284,7 +263,6 @@ void config_set_defaults(void) g_extern.console.screen.state.screenshots.enable = true; g_extern.console.screen.state.throttle.enable = true; - g_extern.console.screen.state.triple_buffering.enable = true; g_extern.console.main_wrap.state.default_savestate_dir.enable = false; g_extern.console.main_wrap.state.default_sram_dir.enable = false;