diff --git a/data/gui/custom_video_settings.stkgui b/data/gui/custom_video_settings.stkgui index 900a024a7..466036696 100644 --- a/data/gui/custom_video_settings.stkgui +++ b/data/gui/custom_video_settings.stkgui @@ -23,26 +23,25 @@
-
-
-
- +
diff --git a/data/gui/options_video.stkgui b/data/gui/options_video.stkgui index 235eb8c0d..9e538da8f 100644 --- a/data/gui/options_video.stkgui +++ b/data/gui/options_video.stkgui @@ -24,7 +24,7 @@
- +
diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp index 0129a865c..25baea4fc 100644 --- a/src/config/user_config.hpp +++ b/src/config/user_config.hpp @@ -494,10 +494,10 @@ namespace UserConfigParams &m_graphics_quality, "Whether trilinear filtering is allowed to be " "used (true or false)") ); - PARAM_PREFIX BoolUserConfigParam m_fullscreen_antialiasing - PARAM_DEFAULT( BoolUserConfigParam(false, - "fullscreen_antialiasing", &m_graphics_quality, - "Whether fullscreen antialiasing is enabled") ); + PARAM_PREFIX IntUserConfigParam m_antialiasing + PARAM_DEFAULT( IntUserConfigParam(0, + "antialiasing", &m_graphics_quality, + "Whether antialiasing is enabled (0 = disabled, 1 = 2x, 2 = 4x, 3 = 8x") ); PARAM_PREFIX BoolUserConfigParam m_vsync PARAM_DEFAULT( BoolUserConfigParam(false, "vsync", &m_graphics_quality, diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 0307498ba..1473dd0a1 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -252,8 +252,23 @@ void IrrDriver::initDevice() params.WindowSize = core::dimension2du(UserConfigParams::m_width, UserConfigParams::m_height); - if (UserConfigParams::m_fullscreen_antialiasing) + switch ((int)UserConfigParams::m_antialiasing) + { + case 0: + break; + case 1: + params.AntiAlias = 2; + break; + case 2: params.AntiAlias = 4; + break; + case 3: + params.AntiAlias = 8; + break; + default: + fprintf(stderr, "[IrrDriver] WARNING: Invalid value for anti-alias setting : %i\n", + (int)UserConfigParams::m_antialiasing); + } m_device = createDeviceEx(params); diff --git a/src/states_screens/dialogs/custom_video_settings.cpp b/src/states_screens/dialogs/custom_video_settings.cpp index eca52334c..d051f4e05 100644 --- a/src/states_screens/dialogs/custom_video_settings.cpp +++ b/src/states_screens/dialogs/custom_video_settings.cpp @@ -76,7 +76,13 @@ void CustomVideoSettingsialog::beforeAddingWidgets() filtering->setValue( value ); - getWidget("antialiasing")->setState( UserConfigParams::m_fullscreen_antialiasing ); + SpinnerWidget* antialias = getWidget("antialiasing"); + antialias->addLabel( _("Disabled") ); // 0 + antialias->addLabel( L"x2" ); // 1 + antialias->addLabel( L"x4" ); // 2 + antialias->addLabel( L"x8" ); // 3 + antialias->setValue( UserConfigParams::m_antialiasing ); + getWidget("postprocessing")->setState( UserConfigParams::m_postprocess_enabled ); getWidget("pixelshaders")->setState( UserConfigParams::m_pixel_shaders ); } @@ -91,8 +97,8 @@ GUIEngine::EventPropagation CustomVideoSettingsialog::processEvent(const std::st getWidget("anim_gfx")->getState(); UserConfigParams::m_weather_effects = getWidget("weather_gfx")->getState(); - UserConfigParams::m_fullscreen_antialiasing = - getWidget("antialiasing")->getState(); + UserConfigParams::m_antialiasing = + getWidget("antialiasing")->getValue(); UserConfigParams::m_postprocess_enabled = getWidget("postprocessing")->getState(); UserConfigParams::m_show_steering_animations = diff --git a/src/states_screens/options_screen_video.cpp b/src/states_screens/options_screen_video.cpp index feadd61c7..4a4feb938 100644 --- a/src/states_screens/options_screen_video.cpp +++ b/src/states_screens/options_screen_video.cpp @@ -45,15 +45,15 @@ using namespace GUIEngine; DEFINE_SCREEN_SINGLETON( OptionsScreenVideo ); // Look-up table for GFX levels -const bool GFX [] = {false, true, true, true, true, true, true}; -const int GFX_ANIM_KARTS[] = {0, 0, 1, 2, 2, 2, 2}; -const bool GFX_WEATHER [] = {false, false, false, false, true, true, true}; -const bool GFX_ANTIALIAS [] = {false, false, false, false, false, true, true}; +const bool GFX [] = {false, true, true, true, true, true, true, true}; +const int GFX_ANIM_KARTS[] = {0, 0, 1, 2, 2, 2, 2, 2}; +const bool GFX_WEATHER [] = {false, false, false, false, true, true, true, true}; +const int GFX_ANTIALIAS [] = {0, 0, 0, 0, 0, 2, 2, 3}; const bool GFX_POSTPROCESSING[] = - {false, false, false, false, false, false, true}; + {false, false, false, false, false, false, true, true}; const bool GFX_PIXEL_SHADERS[] = - {false, false, false, false, true, true, true}; -const int GFX_LEVEL_AMOUNT = 7; + {false, false, false, false, true, true, true, true}; +const int GFX_LEVEL_AMOUNT = 8; // ---------------------------------------------------------------------------- @@ -316,7 +316,7 @@ void OptionsScreenVideo::updateGfxSlider() if (UserConfigParams::m_show_steering_animations == GFX_ANIM_KARTS[l]&& UserConfigParams::m_graphical_effects == GFX[l] && UserConfigParams::m_weather_effects == GFX_WEATHER[l] && - UserConfigParams::m_fullscreen_antialiasing == GFX_ANTIALIAS[l] && + UserConfigParams::m_antialiasing == GFX_ANTIALIAS[l] && UserConfigParams::m_postprocess_enabled == GFX_POSTPROCESSING[l] && UserConfigParams::m_pixel_shaders == GFX_PIXEL_SHADERS[l]) { @@ -357,6 +357,19 @@ void OptionsScreenVideo::updateTooltip() //I18N: if no kart animations are enabled core::stringw none = _LTR("None"); + core::stringw antialias_label; + switch ((int)UserConfigParams::m_antialiasing) + { + case 0: + antialias_label = disabled; break; + case 1: + antialias_label = L"x2"; break; + case 2: + antialias_label = L"x4"; break; + case 3: + antialias_label = L"x8"; break; + } + //I18N: in graphical options tooltip = _("Animated Scenery : %s", UserConfigParams::m_graphical_effects ? enabled : disabled); @@ -369,8 +382,8 @@ void OptionsScreenVideo::updateTooltip() ? all : (UserConfigParams::m_show_steering_animations == 1 ? me : none)); //I18N: in graphical options - tooltip = tooltip + L"\n" + _("Anti-aliasing (requires restart) : %s", - UserConfigParams::m_fullscreen_antialiasing ? enabled : disabled); + tooltip = tooltip + L"\n" + _("Anti-aliasing (requires restart) : %s", + antialias_label); //I18N: in graphical options tooltip = tooltip + L"\n" + _("Pixel shaders : %s", UserConfigParams::m_pixel_shaders ? enabled : disabled); @@ -448,7 +461,7 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name, UserConfigParams::m_show_steering_animations = GFX_ANIM_KARTS[level-1]; UserConfigParams::m_graphical_effects = GFX[level-1]; UserConfigParams::m_weather_effects = GFX_WEATHER[level-1]; - UserConfigParams::m_fullscreen_antialiasing = GFX_ANTIALIAS[level-1]; + UserConfigParams::m_antialiasing = GFX_ANTIALIAS[level-1]; UserConfigParams::m_postprocess_enabled = GFX_POSTPROCESSING[level-1]; UserConfigParams::m_pixel_shaders = GFX_PIXEL_SHADERS[level-1];