Implement selection of upscaling filter in launcher

This commit is contained in:
Ivan Savenko committed 2024-08-17 15:25:26 +00:00
1 parent f29a687234
commit d6059b044d
11 files changed
+173 -32

No files matched your search

+21 -2
View File
@@ -39,6 +39,15 @@ static constexpr std::array cursorTypesList =
};
static constexpr std::array upscalingFilterTypes =
{
"auto",
"none",
"xbrz2",
"xbrz3",
"xbrz4"
};
static constexpr std::array downscalingFilterTypes =
{
"nearest",
"linear",
@@ -138,10 +147,14 @@ void CSettingsView::loadSettings()
Languages::fillLanguages(ui->comboBoxLanguage, false);
fillValidRenderers();
std::string upscalingFilter = settings["video"]["scalingMode"].String();
std::string upscalingFilter = settings["video"]["upscalingFilter"].String();
int upscalingFilterIndex = vstd::find_pos(upscalingFilterTypes, upscalingFilter);
ui->comboBoxUpscalingFilter->setCurrentIndex(upscalingFilterIndex);
std::string downscalingFilter = settings["video"]["downscalingFilter"].String();
int downscalingFilterIndex = vstd::find_pos(downscalingFilterTypes, upscalingFilter);
ui->comboBoxDownscalingFilter->setCurrentIndex(downscalingFilterIndex);
ui->sliderMusicVolume->setValue(settings["general"]["music"].Integer());
ui->sliderSoundVolume->setValue(settings["general"]["sound"].Integer());
ui->sliderRelativeCursorSpeed->setValue(settings["general"]["relativePointerSpeedMultiplier"].Integer());
@@ -645,10 +658,16 @@ void CSettingsView::on_buttonIgnoreSslErrors_clicked(bool checked)
void CSettingsView::on_comboBoxUpscalingFilter_currentIndexChanged(int index)
{
Settings node = settings.write["video"]["scalingMode"];
Settings node = settings.write["video"]["upscalingFilter"];
node->String() = upscalingFilterTypes[index];
}
void CSettingsView::on_comboBoxDownscalingFilter_currentIndexChanged(int index)
{
Settings node = settings.write["video"]["downscalingFilter"];
node->String() = downscalingFilterTypes[index];
}
void CSettingsView::on_sliderMusicVolume_valueChanged(int value)
{
Settings node = settings.write["general"]["music"];
@@ -67,6 +67,7 @@ private slots:
void on_buttonIgnoreSslErrors_clicked(bool checked);
void on_comboBoxUpscalingFilter_currentIndexChanged(int index);
void on_comboBoxDownscalingFilter_currentIndexChanged(int index);
void on_sliderMusicVolume_valueChanged(int value);
void on_sliderSoundVolume_valueChanged(int value);
void on_buttonRelativeCursorMode_toggled(bool value);
+42 -14
View File
@@ -48,8 +48,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>730</width>
<height>1691</height>
<width>729</width>
<height>1396</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="2,0,1,1,1">
@@ -57,7 +57,6 @@
<widget class="QLabel" name="labelGeneral">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -301,7 +300,6 @@
<widget class="QLabel" name="labelArtificialIntelligence">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -516,7 +514,6 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
<widget class="QLabel" name="labelVideo">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -532,7 +529,6 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
<widget class="QLabel" name="labelAudio">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -606,7 +602,7 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
</widget>
</item>
<item row="23" column="1" colspan="4">
<widget class="QComboBox" name="comboBoxUpscalingFilter">
<widget class="QComboBox" name="comboBoxDownscalingFilter">
<item>
<property name="text">
<string>Nearest</string>
@@ -619,7 +615,7 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
</item>
<item>
<property name="text">
<string>Best (Linear)</string>
<string>Automatic (Linear)</string>
</property>
</item>
</widget>
@@ -747,7 +743,6 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
<widget class="QLabel" name="labelInputMouse_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -852,7 +847,6 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
<widget class="QLabel" name="labelNetwork">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -894,9 +888,9 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
</widget>
</item>
<item row="23" column="0">
<widget class="QLabel" name="labelUpscalingFilter">
<widget class="QLabel" name="labelDownscalingFilter">
<property name="text">
<string>Upscaling Filter</string>
<string>Downscaling Filter</string>
</property>
</widget>
</item>
@@ -942,7 +936,6 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
<widget class="QLabel" name="labelInputMouse">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -1020,7 +1013,6 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
<widget class="QLabel" name="labelInputMouse_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -1160,6 +1152,42 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
</property>
</widget>
</item>
<item row="22" column="0">
<widget class="QLabel" name="labelUpscalingFilter">
<property name="text">
<string>Upscaling Filter</string>
</property>
</widget>
</item>
<item row="22" column="1" colspan="4">
<widget class="QComboBox" name="comboBoxUpscalingFilter">
<item>
<property name="text">
<string>Automatic</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>xBRZ x2</string>
</property>
</item>
<item>
<property name="text">
<string>xBRZ x3</string>
</property>
</item>
<item>
<property name="text">
<string>xBRZ x4</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget>