Skip to content

Commit

Permalink
Fix #5076
Browse files Browse the repository at this point in the history
  • Loading branch information
Alayan-stk-2 committed May 12, 2024
1 parent 3ec2b9a commit 53b6267
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion data/gui/dialogs/custom_video_settings.stkgui
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<div layout="horizontal-row" width="100%" proportion="1">
<label text="Rendered image quality" I18N="Video settings" width="40%"/>
<spacer width="10" height="10"/>
<gauge id="image_quality" min_value="0" max_value="2" width="50%" />
<gauge id="image_quality" min_value="0" max_value="3" width="50%" />
</div>

<spacer height="4" width="10" />
Expand Down
1 change: 1 addition & 0 deletions src/states_screens/dialogs/custom_video_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
SpinnerWidget* filtering = getWidget<SpinnerWidget>("image_quality");
filtering->addLabel(_("Very Low"));
filtering->addLabel(_("Low"));
filtering->addLabel(_("Medium"));
filtering->addLabel(_("High"));
filtering->setValue(OptionsScreenVideo::getImageQuality());

Expand Down
37 changes: 25 additions & 12 deletions src/states_screens/options/options_screen_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void OptionsScreenVideo::initPresets()
({
false /* light */, 0 /* shadow */, false /* bloom */, false /* lightshaft */,
false /* glow */, false /* mlaa */, false /* ssao */, false /* light scatter */,
true /* animatedCharacters */, 2 /* particles */, 0 /* image_quality */,
true /* animatedCharacters */, 2 /* particles */, 1 /* image_quality */,
true /* degraded IBL */, 1 /* Geometry Detail */
});

Expand All @@ -66,23 +66,23 @@ void OptionsScreenVideo::initPresets()
({
true /* light */, 0 /* shadow */, false /* bloom */, true /* lightshaft */,
true /* glow */, true /* mlaa */, false /* ssao */, true /* light scatter */,
true /* animatedCharacters */, 2 /* particles */, 1 /* image_quality */,
true /* animatedCharacters */, 2 /* particles */, 2 /* image_quality */,
false /* degraded IBL */, 3 /* Geometry Detail */
});

m_presets.push_back // Level 5
({
true /* light */, 512 /* shadow */, true /* bloom */, true /* lightshaft */,
true /* glow */, true /* mlaa */, false /* ssao */, true /* light scatter */,
true /* animatedCharacters */, 2 /* particles */, 2 /* image_quality */,
true /* animatedCharacters */, 2 /* particles */, 3 /* image_quality */,
false /* degraded IBL */, 3 /* Geometry Detail */
});

m_presets.push_back // Level 6
({
true /* light */, 1024 /* shadow */, true /* bloom */, true /* lightshaft */,
true /* glow */, true /* mlaa */, true /* ssao */, true /* light scatter */,
true /* animatedCharacters */, 2 /* particles */, 2 /* image_quality */,
true /* animatedCharacters */, 2 /* particles */, 3 /* image_quality */,
false /* degraded IBL */, 4 /* Geometry Detail */
});

Expand Down Expand Up @@ -122,18 +122,22 @@ void OptionsScreenVideo::initPresets()
// --------------------------------------------------------------------------------------------
int OptionsScreenVideo::getImageQuality()
{
if (UserConfigParams::m_anisotropic == 2 &&
if (UserConfigParams::m_anisotropic == 4 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x00 &&
UserConfigParams::m_hq_mipmap == false)
return 0;
if (UserConfigParams::m_anisotropic == 4 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x01 &&
if (UserConfigParams::m_anisotropic == 16 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x00 &&
UserConfigParams::m_hq_mipmap == false)
return 1;
if (UserConfigParams::m_anisotropic == 16 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x01 &&
UserConfigParams::m_hq_mipmap == true)
UserConfigParams::m_hq_mipmap == false)
return 2;
if (UserConfigParams::m_anisotropic == 16 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x01 &&
UserConfigParams::m_hq_mipmap == true)
return 3;
return 1;
} // getImageQuality

Expand All @@ -147,20 +151,27 @@ void OptionsScreenVideo::setImageQuality(int quality)
switch (quality)
{
case 0:
UserConfigParams::m_anisotropic = 2;
UserConfigParams::m_anisotropic = 4;
UserConfigParams::m_high_definition_textures = 0x02;
UserConfigParams::m_hq_mipmap = false;
if (td)
td->setSamplerUse(GE::GVS_3D_MESH_MIPMAP_2);
break;
case 1:
UserConfigParams::m_anisotropic = 4;
UserConfigParams::m_anisotropic = 16;
UserConfigParams::m_high_definition_textures = 0x02;
UserConfigParams::m_hq_mipmap = false;
if (td)
td->setSamplerUse(GE::GVS_3D_MESH_MIPMAP_2);
break;
case 2:
UserConfigParams::m_anisotropic = 16;
UserConfigParams::m_high_definition_textures = 0x03;
UserConfigParams::m_hq_mipmap = false;
if (td)
td->setSamplerUse(GE::GVS_3D_MESH_MIPMAP_4);
break;
case 2:
case 3:
UserConfigParams::m_anisotropic = 16;
UserConfigParams::m_high_definition_textures = 0x03;
UserConfigParams::m_hq_mipmap = true;
Expand Down Expand Up @@ -483,7 +494,9 @@ void OptionsScreenVideo::updateTooltip()
//I18N: in graphical options
int quality = getImageQuality();
tooltip = tooltip + L"\n" + _("Rendered image quality: %s",
quality == 0 ? very_low : quality == 1 ? low : high);
quality == 0 ? very_low :
quality == 1 ? low :
quality == 2 ? medium : high);

//I18N: in graphical options
int geometry_detail = (UserConfigParams::m_geometry_level == 0 ? 2 :
Expand Down

0 comments on commit 53b6267

Please sign in to comment.