First reorganisation of graphics options. Remove old MSAA anti-aliasing, offer only new MLAA. Organise options in more logical groups, improve overall popup layout

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14596 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2013-12-01 19:05:44 +00:00
parent 4e2a553b1f
commit e5fbd5d1fb
5 changed files with 61 additions and 45 deletions

View File

@ -1,6 +1,6 @@
<stkgui>
<div x="2%" y="5%" width="96%" height="95%" layout="vertical-row" >
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" >
<header id="title" width="100%" height="fit" text_align="center" word_wrap="true" text="Graphics Settings" />
@ -15,20 +15,41 @@
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<checkbox id="anim_gfx"/>
<spacer width="10" height="10"/>
<label text="Animated Scenery" I18N="Video settings"/>
<spacer width="20%" height="10"/>
<spacer width="50" height="10" />
<checkbox id="motionblur"/>
<spacer width="10" height="10"/>
<label text="Motion blur" I18N="Video settings"/>
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<spacer width="50" height="10" />
<checkbox id="mlaa"/>
<spacer width="10" height="10"/>
<label text="Anti-aliasing" I18N="Video settings"/>
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<spacer width="50" height="10" />
<label text="Ambient Occlusion" I18N="Video settings"/>
<spacer width="10" height="10"/>
<gauge id="ssao" min_value="0" max_value="2" width="50%"/>
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<spacer width="50" height="10" />
<label text="Shadows (requires restart)" I18N="Video settings"/>
<spacer width="10" height="10"/>
<gauge id="shadows" min_value="0" max_value="2" width="50%"/>
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<checkbox id="weather_gfx"/>
<spacer width="10" height="10"/>
@ -37,6 +58,14 @@
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<checkbox id="anim_gfx"/>
<spacer width="10" height="10"/>
<label text="Animated Scenery" I18N="Video settings"/>
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<label text="Animated Characters" I18N="Video settings" width="40%"/>
<spacer width="10" height="10"/>
@ -51,8 +80,7 @@
<gauge id="filtering" min_value="0" max_value="5" width="50%" />
</div>
<spacer height="4" width="10" />
<!--
<div layout="horizontal-row" width="100%" height="fit">
<label text="Anti-aliasing (requires restart)" I18N="Video settings" width="40%" />
<spacer width="10" height="10"/>
@ -60,33 +88,12 @@
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<checkbox id="mlaa"/>
<spacer width="10" height="10"/>
<label text="MLAA (morphological anti-aliasing)" I18N="Video settings"/>
</div>
-->
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<label text="SSAO (Ambient Occlusion, requires restart)" I18N="Video settings"/>
<spacer width="10" height="10"/>
<gauge id="ssao" min_value="0" max_value="2" width="50%"/>
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" height="fit">
<label text="Shadows (requires restart)" I18N="Video settings"/>
<spacer width="10" height="10"/>
<gauge id="shadows" min_value="0" max_value="2" width="50%"/>
</div>
<spacer proportion="1"/>
<button id="close" text="Close" align="center"/>
</div>
</stkgui>

View File

@ -536,10 +536,12 @@ namespace UserConfigParams
&m_graphics_quality,
"Whether trilinear filtering is allowed to be "
"used (true or false)") );
/*
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,
@ -555,7 +557,7 @@ namespace UserConfigParams
PARAM_PREFIX BoolUserConfigParam m_mlaa
PARAM_DEFAULT( BoolUserConfigParam(false,
"mlaa", &m_graphics_quality,
"Whether MLAA should be enabled") );
"Whether MLAA anti-aliasing should be enabled") );
PARAM_PREFIX IntUserConfigParam m_ssao
PARAM_DEFAULT( IntUserConfigParam(0,
"ssao", &m_graphics_quality,

View File

@ -337,6 +337,8 @@ void IrrDriver::initDevice()
params.WindowSize =
core::dimension2du(UserConfigParams::m_width,
UserConfigParams::m_height);
/*
switch ((int)UserConfigParams::m_antialiasing)
{
case 0:
@ -356,6 +358,7 @@ void IrrDriver::initDevice()
"anti-alias setting : %i\n",
(int)UserConfigParams::m_antialiasing);
}
*/
m_device = createDeviceEx(params);
if(m_device)
break;
@ -449,7 +452,7 @@ void IrrDriver::initDevice()
}
else
{
Log::warn("irr_driver", "Too old GPU; using the fixed pipeline.");
Log::warn("irr_driver", "Using the fixed pipeline (old GPU, or shaders disabled in options)");
}
// Only change video driver settings if we are showing graphics

View File

@ -76,12 +76,14 @@ void CustomVideoSettingsialog::beforeAddingWidgets()
filtering->setValue( value );
/*
SpinnerWidget* antialias = getWidget<SpinnerWidget>("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 );
*/
SpinnerWidget* ssao = getWidget<SpinnerWidget>("ssao");
ssao->addLabel( _("Disabled") ); // 0
@ -94,10 +96,10 @@ void CustomVideoSettingsialog::beforeAddingWidgets()
shadows->addLabel( _("low") ); // 1
shadows->addLabel( _("high") ); // 2
shadows->setValue( UserConfigParams::m_shadows );
getWidget<CheckBoxWidget>("motionblur")->setState( UserConfigParams::m_motionblur );
getWidget<CheckBoxWidget>("mlaa")->setState( UserConfigParams::m_mlaa );
getWidget<CheckBoxWidget>("pixelshaders")->setState( UserConfigParams::m_pixel_shaders );
getWidget<CheckBoxWidget>("pixelshaders")->setState(UserConfigParams::m_pixel_shaders);
}
// -----------------------------------------------------------------------------
@ -110,8 +112,8 @@ GUIEngine::EventPropagation CustomVideoSettingsialog::processEvent(const std::st
getWidget<CheckBoxWidget>("anim_gfx")->getState();
UserConfigParams::m_weather_effects =
getWidget<CheckBoxWidget>("weather_gfx")->getState();
UserConfigParams::m_antialiasing =
getWidget<SpinnerWidget>("antialiasing")->getValue();
//UserConfigParams::m_antialiasing =
// getWidget<SpinnerWidget>("antialiasing")->getValue();
UserConfigParams::m_motionblur =
getWidget<CheckBoxWidget>("motionblur")->getState();
UserConfigParams::m_show_steering_animations =

View File

@ -48,7 +48,7 @@ DEFINE_SCREEN_SINGLETON( OptionsScreenVideo );
static const bool GFX [] = {false, true, true, true, true, true, true, true};
static const int GFX_ANIM_KARTS[] = {0, 1, 2, 2, 2, 2, 2, 2};
static const bool GFX_WEATHER [] = {false, false, true, true, true, true, true, true};
static const int GFX_ANTIALIAS [] = {0, 0, 0, 0, 0, 2, 2, 3};
//static const int GFX_ANTIALIAS [] = {0, 0, 0, 0, 0, 2, 2, 3};
static const bool GFX_MOTIONBLUR[] =
{false, false, false, false, true, true, true, true};
static const bool GFX_PIXEL_SHADERS[] =
@ -314,7 +314,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_antialiasing == GFX_ANTIALIAS[l] &&
//UserConfigParams::m_antialiasing == GFX_ANTIALIAS[l] &&
UserConfigParams::m_motionblur == GFX_MOTIONBLUR[l] &&
UserConfigParams::m_mlaa == GFX_MLAA[l] &&
UserConfigParams::m_ssao == GFX_SSAO[l] &&
@ -359,6 +359,7 @@ void OptionsScreenVideo::updateTooltip()
//I18N: if no kart animations are enabled
const core::stringw none = _LTR("None");
/*
core::stringw antialias_label;
switch ((int)UserConfigParams::m_antialiasing)
{
@ -371,6 +372,7 @@ void OptionsScreenVideo::updateTooltip()
case 3:
antialias_label = L"x8"; break;
}
*/
//I18N: in graphical options
tooltip = tooltip + L"\n" + _("Pixel shaders : %s",
@ -387,16 +389,16 @@ 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",
antialias_label);
//tooltip = tooltip + L"\n" + _("Anti-aliasing (requires restart) : %s",
// antialias_label);
//I18N: in graphical options
tooltip = tooltip + L"\n" + _("Motion blur: %s",
UserConfigParams::m_motionblur ? enabled : disabled);
//I18N: in graphical options
tooltip = tooltip + L"\n" + _("MLAA: %s",
tooltip = tooltip + L"\n" + _("Anti-aliasing : %s",
UserConfigParams::m_mlaa ? enabled : disabled);
//I18N: in graphical options
tooltip = tooltip + L"\n" + _("SSAO: %s",
tooltip = tooltip + L"\n" + _("Ambient occlusion : %s",
UserConfigParams::m_ssao == 1 ? "low" : UserConfigParams::m_ssao == 2 ?
"high" : disabled);
//I18N: in graphical options
@ -477,7 +479,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_antialiasing = GFX_ANTIALIAS[level-1];
//UserConfigParams::m_antialiasing = GFX_ANTIALIAS[level-1];
UserConfigParams::m_motionblur = GFX_MOTIONBLUR[level-1];
UserConfigParams::m_pixel_shaders = GFX_PIXEL_SHADERS[level-1];
UserConfigParams::m_mlaa = GFX_MLAA[level-1];