diff --git a/console/rarch_console_config.c b/console/rarch_console_config.c index ddceae424b..430a4c3faf 100644 --- a/console/rarch_console_config.c +++ b/console/rarch_console_config.c @@ -60,9 +60,6 @@ void rarch_config_load(const char *conf_name, bool upgrade_core_succeeded) CONFIG_GET_BOOL(video.second_pass_smooth, "video_second_pass_smooth"); #endif CONFIG_GET_BOOL(video.smooth, "video_smooth"); -#ifdef HAVE_FBO - CONFIG_GET_BOOL(video.fbo.enable, "fbo_enabled"); -#endif CONFIG_GET_BOOL(video.vsync, "video_vsync"); CONFIG_GET_INT(video.aspect_ratio_idx, "aspect_ratio_index"); CONFIG_GET_FLOAT(video.aspect_ratio, "video_aspect_ratio"); @@ -143,7 +140,6 @@ void rarch_config_save(const char * conf_name) config_set_string(conf, "video_second_pass_shader", g_settings.video.second_pass_shader); config_set_bool(conf, "video_render_to_texture", g_settings.video.render_to_texture); config_set_bool(conf, "video_second_pass_smooth", g_settings.video.second_pass_smooth); - config_set_bool(conf, "fbo_enabled", g_settings.video.fbo.enable); #endif config_set_bool(conf, "video_smooth", g_settings.video.smooth); config_set_bool(conf, "video_vsync", g_settings.video.vsync); diff --git a/console/rarch_console_settings.c b/console/rarch_console_settings.c index 8c75155123..42ae687b4e 100644 --- a/console/rarch_console_settings.c +++ b/console/rarch_console_settings.c @@ -137,7 +137,7 @@ void rarch_settings_change(unsigned setting) g_extern.state_slot++; break; case S_SCALE_ENABLED: - g_settings.video.fbo.enable = !g_settings.video.fbo.enable; + g_settings.video.render_to_texture = !g_settings.video.render_to_texture; break; case S_SCALE_FACTOR_DECREMENT: g_settings.video.fbo.scale_x -= 1.0f; @@ -202,7 +202,7 @@ void rarch_settings_default(unsigned setting) g_extern.state_slot = 0; break; case S_DEF_SCALE_ENABLED: - g_settings.video.fbo.enable = true; + g_settings.video.render_to_texture = true; g_settings.video.fbo.scale_x = 2.0f; g_settings.video.fbo.scale_y = 2.0f; break; @@ -395,11 +395,6 @@ void rarch_settings_set_default(void) g_extern.console.screen.resolutions.current.id = 0; strlcpy(g_extern.console.main_wrap.paths.default_rom_startup_dir, default_paths.filebrowser_startup_dir, sizeof(g_extern.console.main_wrap.paths.default_rom_startup_dir)); strlcpy(g_extern.console.main_wrap.paths.default_savestate_dir, default_paths.savestate_dir, sizeof(g_extern.console.main_wrap.paths.default_savestate_dir)); -#ifdef HAVE_FBO - g_settings.video.fbo.enable = true; -#else - g_settings.video.fbo.enable = false; -#endif g_settings.video.aspect_ratio_idx = 0; g_extern.console.block_config_read = true; g_extern.console.screen.state.frame_advance.enable = false; diff --git a/console/rmenu/rmenu.c b/console/rmenu/rmenu.c index 97dba1c13d..3e41cabfdf 100644 --- a/console/rmenu/rmenu.c +++ b/console/rmenu/rmenu.c @@ -209,8 +209,8 @@ static void populate_setting_item(unsigned i, item *current_item) break; case SETTING_SCALE_ENABLED: snprintf(current_item->text, sizeof(current_item->text), "Custom Scaling/Dual Shaders"); - snprintf(current_item->setting_text, sizeof(current_item->setting_text), g_settings.video.fbo.enable ? "ON" : "OFF"); - snprintf(current_item->comment, sizeof(current_item->comment), g_settings.video.fbo.enable ? "INFO - [Custom Scaling] is set to 'ON' - 2x shaders will look much\nbetter, and you can select a shader for [Shader #2]." : "INFO - [Custom Scaling] is set to 'OFF'."); + snprintf(current_item->setting_text, sizeof(current_item->setting_text), g_settings.video.render_to_texture ? "ON" : "OFF"); + snprintf(current_item->comment, sizeof(current_item->comment), g_settings.video.render_to_texture ? "INFO - [Custom Scaling] is set to 'ON' - 2x shaders will look much\nbetter, and you can select a shader for [Shader #2]." : "INFO - [Custom Scaling] is set to 'OFF'."); break; case SETTING_SCALE_FACTOR: snprintf(current_item->text, sizeof(current_item->text), "Custom Scaling Factor"); @@ -1058,7 +1058,7 @@ static void set_setting_action(menu *current_menu, unsigned switchvalue, uint64_ if((input & (1 << RMENU_DEVICE_NAV_LEFT)) || (input & (1 << RMENU_DEVICE_NAV_RIGHT)) || (input & (1 << RMENU_DEVICE_NAV_B))) { rarch_settings_change(S_SCALE_ENABLED); - context->set_fbo_enable(g_settings.video.fbo.enable); + context->set_fbo_enable(g_settings.video.render_to_texture); } if(input & (1 << RMENU_DEVICE_NAV_START)) { @@ -1070,7 +1070,7 @@ static void set_setting_action(menu *current_menu, unsigned switchvalue, uint64_ case SETTING_SCALE_FACTOR: if(input & (1 << RMENU_DEVICE_NAV_LEFT)) { - if(g_settings.video.fbo.enable) + if(g_settings.video.render_to_texture) { bool should_decrement = g_settings.video.fbo.scale_x > MIN_SCALING_FACTOR; @@ -1083,7 +1083,7 @@ static void set_setting_action(menu *current_menu, unsigned switchvalue, uint64_ } if((input & (1 << RMENU_DEVICE_NAV_RIGHT)) || (input & (1 << RMENU_DEVICE_NAV_B))) { - if(g_settings.video.fbo.enable) + if(g_settings.video.render_to_texture) { bool should_increment = g_settings.video.fbo.scale_x < MAX_SCALING_FACTOR; if(should_increment) diff --git a/general.h b/general.h index 5b6dc415e9..b8fb65feeb 100644 --- a/general.h +++ b/general.h @@ -113,7 +113,6 @@ struct settings { float scale_x; float scale_y; - bool enable; } fbo; char second_pass_shader[PATH_MAX]; diff --git a/gfx/context/ps3_ctx.c b/gfx/context/ps3_ctx.c index 92bb2e3924..0e5ecf9119 100644 --- a/gfx/context/ps3_ctx.c +++ b/gfx/context/ps3_ctx.c @@ -401,7 +401,6 @@ static void gfx_ctx_set_fbo(bool enable) { gl_t *gl = driver.video_data; gl->fbo_inited = enable; - gl->render_to_tex = enable; } static void gfx_ctx_apply_fbo_state_changes(unsigned mode) diff --git a/gfx/gl.c b/gfx/gl.c index 3d39d68dfc..20cb52726b 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -1597,16 +1597,18 @@ static void gl_start(void) video_info.smooth = g_settings.video.smooth; video_info.input_scale = 2; video_info.fullscreen = true; + if (g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { video_info.width = g_extern.console.screen.viewports.custom_vp.width; video_info.height = g_extern.console.screen.viewports.custom_vp.height; } + driver.video_data = gl_init(&video_info, NULL, NULL); gl_t *gl = (gl_t*)driver.video_data; - context_set_fbo_func(g_settings.video.fbo.enable); + context_set_fbo_func(g_settings.video.render_to_texture); context_get_available_resolutions_func(); gl_init_menu(gl); @@ -1614,7 +1616,7 @@ static void gl_start(void) #ifdef HAVE_FBO // FBO mode has to be enabled once even if FBO mode has to be // turned off - if (!g_settings.video.fbo.enable) + if (!g_settings.video.render_to_texture) { context_apply_fbo_state_changes_func(FBO_DEINIT); context_apply_fbo_state_changes_func(FBO_INIT);