mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 08:35:45 -04:00
GameSettings: Add PGXP tolerance and MSAA
This commit is contained in:
@ -135,6 +135,9 @@ void GamePropertiesDialog::setupAdditionalUi()
|
||||
m_ui.userResolutionScale->addItem(tr("(unchanged)"));
|
||||
QtUtils::FillComboBoxWithResolutionScales(m_ui.userResolutionScale);
|
||||
|
||||
m_ui.userMSAAMode->addItem(tr("(unchanged)"));
|
||||
QtUtils::FillComboBoxWithMSAAModes(m_ui.userMSAAMode);
|
||||
|
||||
m_ui.userTextureFiltering->addItem(tr("(unchanged)"));
|
||||
for (u32 i = 0; i < static_cast<u32>(GPUTextureFilter::Count); i++)
|
||||
{
|
||||
@ -307,6 +310,11 @@ void GamePropertiesDialog::populateGameSettings()
|
||||
QSignalBlocker sb(m_ui.gpuMaxRunAhead);
|
||||
m_ui.gpuMaxRunAhead->setValue(static_cast<int>(gs.gpu_max_run_ahead.value()));
|
||||
}
|
||||
if (gs.gpu_pgxp_tolerance.has_value())
|
||||
{
|
||||
QSignalBlocker sb(m_ui.gpuPGXPTolerance);
|
||||
m_ui.gpuPGXPTolerance->setValue(static_cast<double>(gs.gpu_pgxp_tolerance.value()));
|
||||
}
|
||||
|
||||
if (gs.display_crop_mode.has_value())
|
||||
{
|
||||
@ -333,6 +341,21 @@ void GamePropertiesDialog::populateGameSettings()
|
||||
m_ui.userResolutionScale->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
if (gs.gpu_multisamples.has_value() && gs.gpu_per_sample_shading.has_value())
|
||||
{
|
||||
QSignalBlocker sb(m_ui.userMSAAMode);
|
||||
const QVariant current_msaa_mode(
|
||||
QtUtils::GetMSAAModeValue(static_cast<uint>(gs.gpu_multisamples.value()), gs.gpu_per_sample_shading.has_value()));
|
||||
const int current_msaa_index = m_ui.userMSAAMode->findData(current_msaa_mode);
|
||||
if (current_msaa_index >= 0)
|
||||
m_ui.userMSAAMode->setCurrentIndex((current_msaa_index >= 0) ? current_msaa_index : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
QSignalBlocker sb(m_ui.userMSAAMode);
|
||||
m_ui.userMSAAMode->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
if (gs.gpu_texture_filter.has_value())
|
||||
{
|
||||
QSignalBlocker sb(m_ui.userTextureFiltering);
|
||||
@ -497,6 +520,23 @@ void GamePropertiesDialog::connectUi()
|
||||
saveGameSettings();
|
||||
});
|
||||
|
||||
connect(m_ui.userMSAAMode, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) {
|
||||
if (index == 0)
|
||||
{
|
||||
m_game_settings.gpu_multisamples.reset();
|
||||
m_game_settings.gpu_per_sample_shading.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
uint multisamples;
|
||||
bool ssaa;
|
||||
QtUtils::DecodeMSAAModeValue(m_ui.userMSAAMode->itemData(index), &multisamples, &ssaa);
|
||||
m_game_settings.gpu_multisamples = static_cast<u32>(multisamples);
|
||||
m_game_settings.gpu_per_sample_shading = ssaa;
|
||||
}
|
||||
saveGameSettings();
|
||||
});
|
||||
|
||||
connect(m_ui.userTextureFiltering, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) {
|
||||
if (index <= 0)
|
||||
m_game_settings.gpu_texture_filter.reset();
|
||||
@ -633,6 +673,13 @@ void GamePropertiesDialog::connectUi()
|
||||
m_game_settings.gpu_max_run_ahead = static_cast<u32>(value);
|
||||
saveGameSettings();
|
||||
});
|
||||
connect(m_ui.gpuPGXPTolerance, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [this](double value) {
|
||||
if (value < 0.0)
|
||||
m_game_settings.gpu_pgxp_tolerance.reset();
|
||||
else
|
||||
m_game_settings.gpu_pgxp_tolerance = static_cast<float>(value);
|
||||
saveGameSettings();
|
||||
});
|
||||
}
|
||||
|
||||
void GamePropertiesDialog::updateCPUClockSpeedLabel()
|
||||
|
@ -325,16 +325,26 @@
|
||||
<widget class="QComboBox" name="userResolutionScale"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>Multisample Antialiasing:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="userMSAAMode"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_23">
|
||||
<property name="text">
|
||||
<string>Texture Filtering:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="userTextureFiltering"/>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="userTrueColor">
|
||||
@ -741,6 +751,29 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="text">
|
||||
<string>PGXP Geometry Tolerance:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="gpuPGXPTolerance">
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>0.5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Reference in New Issue
Block a user