mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-08 00:40:38 +00:00
Merge pull request #12068 from SuperSamus/manual-texture-game
Qt/GameConfigWidget: Add Manual Texture Sampling
This commit is contained in:
commit
8f1b2280ae
@ -88,8 +88,9 @@ void GameConfigWidget::CreateWidgets()
|
|||||||
m_enable_mmu = new QCheckBox(tr("Enable MMU"));
|
m_enable_mmu = new QCheckBox(tr("Enable MMU"));
|
||||||
m_enable_fprf = new QCheckBox(tr("Enable FPRF"));
|
m_enable_fprf = new QCheckBox(tr("Enable FPRF"));
|
||||||
m_sync_gpu = new QCheckBox(tr("Synchronize GPU thread"));
|
m_sync_gpu = new QCheckBox(tr("Synchronize GPU thread"));
|
||||||
m_enable_fast_disc = new QCheckBox(tr("Emulate Disc Speed"));
|
m_emulate_disc_speed = new QCheckBox(tr("Emulate Disc Speed"));
|
||||||
m_use_dsp_hle = new QCheckBox(tr("DSP HLE (fast)"));
|
m_use_dsp_hle = new QCheckBox(tr("DSP HLE (fast)"));
|
||||||
|
m_manual_texture_sampling = new QCheckBox(tr("Manual Texture Sampling"));
|
||||||
m_deterministic_dual_core = new QComboBox;
|
m_deterministic_dual_core = new QComboBox;
|
||||||
|
|
||||||
for (const auto& item : {tr("Not Set"), tr("auto"), tr("none"), tr("fake-completion")})
|
for (const auto& item : {tr("Not Set"), tr("auto"), tr("none"), tr("fake-completion")})
|
||||||
@ -102,18 +103,20 @@ void GameConfigWidget::CreateWidgets()
|
|||||||
"games. (ON = Compatible, OFF = Fast)"));
|
"games. (ON = Compatible, OFF = Fast)"));
|
||||||
m_sync_gpu->setToolTip(tr("Synchronizes the GPU and CPU threads to help prevent random freezes "
|
m_sync_gpu->setToolTip(tr("Synchronizes the GPU and CPU threads to help prevent random freezes "
|
||||||
"in Dual core mode. (ON = Compatible, OFF = Fast)"));
|
"in Dual core mode. (ON = Compatible, OFF = Fast)"));
|
||||||
m_enable_fast_disc->setToolTip(tr("Enable emulated disc speed. Disabling this can cause crashes "
|
m_emulate_disc_speed->setToolTip(
|
||||||
"and other problems in some games. "
|
tr("Enable emulated disc speed. Disabling this can cause crashes "
|
||||||
"(ON = Compatible, OFF = Unlocked)"));
|
"and other problems in some games. "
|
||||||
|
"(ON = Compatible, OFF = Unlocked)"));
|
||||||
|
|
||||||
core_layout->addWidget(m_enable_dual_core, 0, 0);
|
core_layout->addWidget(m_enable_dual_core, 0, 0);
|
||||||
core_layout->addWidget(m_enable_mmu, 1, 0);
|
core_layout->addWidget(m_enable_mmu, 1, 0);
|
||||||
core_layout->addWidget(m_enable_fprf, 2, 0);
|
core_layout->addWidget(m_enable_fprf, 2, 0);
|
||||||
core_layout->addWidget(m_sync_gpu, 3, 0);
|
core_layout->addWidget(m_sync_gpu, 3, 0);
|
||||||
core_layout->addWidget(m_enable_fast_disc, 4, 0);
|
core_layout->addWidget(m_emulate_disc_speed, 4, 0);
|
||||||
core_layout->addWidget(m_use_dsp_hle, 5, 0);
|
core_layout->addWidget(m_use_dsp_hle, 5, 0);
|
||||||
core_layout->addWidget(new QLabel(tr("Deterministic dual core:")), 6, 0);
|
core_layout->addWidget(m_manual_texture_sampling, 6, 0);
|
||||||
core_layout->addWidget(m_deterministic_dual_core, 6, 1);
|
core_layout->addWidget(new QLabel(tr("Deterministic dual core:")), 7, 0);
|
||||||
|
core_layout->addWidget(m_deterministic_dual_core, 7, 1);
|
||||||
|
|
||||||
// Stereoscopy
|
// Stereoscopy
|
||||||
auto* stereoscopy_box = new QGroupBox(tr("Stereoscopy"));
|
auto* stereoscopy_box = new QGroupBox(tr("Stereoscopy"));
|
||||||
@ -159,8 +162,9 @@ void GameConfigWidget::CreateWidgets()
|
|||||||
|
|
||||||
general_layout->addWidget(m_refresh_config, 1, 0, 1, -1);
|
general_layout->addWidget(m_refresh_config, 1, 0, 1, -1);
|
||||||
|
|
||||||
for (QCheckBox* item : {m_enable_dual_core, m_enable_mmu, m_enable_fprf, m_sync_gpu,
|
for (QCheckBox* item :
|
||||||
m_enable_fast_disc, m_use_dsp_hle, m_use_monoscopic_shadows})
|
{m_enable_dual_core, m_enable_mmu, m_enable_fprf, m_sync_gpu, m_emulate_disc_speed,
|
||||||
|
m_use_dsp_hle, m_manual_texture_sampling, m_use_monoscopic_shadows})
|
||||||
item->setTristate(true);
|
item->setTristate(true);
|
||||||
|
|
||||||
auto* general_widget = new QWidget;
|
auto* general_widget = new QWidget;
|
||||||
@ -206,8 +210,9 @@ void GameConfigWidget::ConnectWidgets()
|
|||||||
// Buttons
|
// Buttons
|
||||||
connect(m_refresh_config, &QPushButton::clicked, this, &GameConfigWidget::LoadSettings);
|
connect(m_refresh_config, &QPushButton::clicked, this, &GameConfigWidget::LoadSettings);
|
||||||
|
|
||||||
for (QCheckBox* box : {m_enable_dual_core, m_enable_mmu, m_enable_fprf, m_sync_gpu,
|
for (QCheckBox* box :
|
||||||
m_enable_fast_disc, m_use_dsp_hle, m_use_monoscopic_shadows})
|
{m_enable_dual_core, m_enable_mmu, m_enable_fprf, m_sync_gpu, m_emulate_disc_speed,
|
||||||
|
m_use_dsp_hle, m_manual_texture_sampling, m_use_monoscopic_shadows})
|
||||||
connect(box, &QCheckBox::stateChanged, this, &GameConfigWidget::SaveSettings);
|
connect(box, &QCheckBox::stateChanged, this, &GameConfigWidget::SaveSettings);
|
||||||
|
|
||||||
connect(m_deterministic_dual_core, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
connect(m_deterministic_dual_core, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||||
@ -219,30 +224,19 @@ void GameConfigWidget::ConnectWidgets()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GameConfigWidget::LoadCheckBox(QCheckBox* checkbox, const std::string& section,
|
void GameConfigWidget::LoadCheckBox(QCheckBox* checkbox, const std::string& section,
|
||||||
const std::string& key)
|
const std::string& key, bool reverse)
|
||||||
{
|
{
|
||||||
bool checked;
|
bool checked;
|
||||||
if (key == "FastDiscSpeed")
|
if (m_gameini_local.GetOrCreateSection(section)->Get(key, &checked))
|
||||||
{
|
return checkbox->setCheckState(checked ^ reverse ? Qt::Checked : Qt::Unchecked);
|
||||||
if (m_gameini_local.GetOrCreateSection(section)->Get("FastDiscSpeed", &checked))
|
|
||||||
return checkbox->setCheckState(!checked ? Qt::Checked : Qt::Unchecked);
|
|
||||||
|
|
||||||
if (m_gameini_default.GetOrCreateSection(section)->Get("FastDiscSpeed", &checked))
|
if (m_gameini_default.GetOrCreateSection(section)->Get(key, &checked))
|
||||||
return checkbox->setCheckState(!checked ? Qt::Checked : Qt::Unchecked);
|
return checkbox->setCheckState(checked ^ reverse ? Qt::Checked : Qt::Unchecked);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (m_gameini_local.GetOrCreateSection(section)->Get(key, &checked))
|
|
||||||
return checkbox->setCheckState(checked ? Qt::Checked : Qt::Unchecked);
|
|
||||||
|
|
||||||
if (m_gameini_default.GetOrCreateSection(section)->Get(key, &checked))
|
|
||||||
return checkbox->setCheckState(checked ? Qt::Checked : Qt::Unchecked);
|
|
||||||
}
|
|
||||||
checkbox->setCheckState(Qt::PartiallyChecked);
|
checkbox->setCheckState(Qt::PartiallyChecked);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameConfigWidget::SaveCheckBox(QCheckBox* checkbox, const std::string& section,
|
void GameConfigWidget::SaveCheckBox(QCheckBox* checkbox, const std::string& section,
|
||||||
const std::string& key)
|
const std::string& key, bool reverse)
|
||||||
{
|
{
|
||||||
// Delete any existing entries from the local gameini if checkbox is undetermined.
|
// Delete any existing entries from the local gameini if checkbox is undetermined.
|
||||||
// Otherwise, write the current value to the local gameini if the value differs from the default
|
// Otherwise, write the current value to the local gameini if the value differs from the default
|
||||||
@ -256,13 +250,7 @@ void GameConfigWidget::SaveCheckBox(QCheckBox* checkbox, const std::string& sect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checked = checkbox->checkState() == Qt::Checked;
|
bool checked = (checkbox->checkState() == Qt::Checked) ^ reverse;
|
||||||
|
|
||||||
if (key == "FastDiscSpeed")
|
|
||||||
{
|
|
||||||
m_gameini_local.GetOrCreateSection(section)->Set(key, !checked);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_gameini_default.Exists(section, key))
|
if (m_gameini_default.Exists(section, key))
|
||||||
{
|
{
|
||||||
@ -293,8 +281,9 @@ void GameConfigWidget::LoadSettings()
|
|||||||
LoadCheckBox(m_enable_mmu, "Core", "MMU");
|
LoadCheckBox(m_enable_mmu, "Core", "MMU");
|
||||||
LoadCheckBox(m_enable_fprf, "Core", "FPRF");
|
LoadCheckBox(m_enable_fprf, "Core", "FPRF");
|
||||||
LoadCheckBox(m_sync_gpu, "Core", "SyncGPU");
|
LoadCheckBox(m_sync_gpu, "Core", "SyncGPU");
|
||||||
LoadCheckBox(m_enable_fast_disc, "Core", "FastDiscSpeed");
|
LoadCheckBox(m_emulate_disc_speed, "Core", "FastDiscSpeed", true);
|
||||||
LoadCheckBox(m_use_dsp_hle, "Core", "DSPHLE");
|
LoadCheckBox(m_use_dsp_hle, "Core", "DSPHLE");
|
||||||
|
LoadCheckBox(m_manual_texture_sampling, "Video_Hacks", "FastTextureSampling", true);
|
||||||
|
|
||||||
std::string determinism_mode;
|
std::string determinism_mode;
|
||||||
|
|
||||||
@ -343,8 +332,9 @@ void GameConfigWidget::SaveSettings()
|
|||||||
SaveCheckBox(m_enable_mmu, "Core", "MMU");
|
SaveCheckBox(m_enable_mmu, "Core", "MMU");
|
||||||
SaveCheckBox(m_enable_fprf, "Core", "FPRF");
|
SaveCheckBox(m_enable_fprf, "Core", "FPRF");
|
||||||
SaveCheckBox(m_sync_gpu, "Core", "SyncGPU");
|
SaveCheckBox(m_sync_gpu, "Core", "SyncGPU");
|
||||||
SaveCheckBox(m_enable_fast_disc, "Core", "FastDiscSpeed");
|
SaveCheckBox(m_emulate_disc_speed, "Core", "FastDiscSpeed", true);
|
||||||
SaveCheckBox(m_use_dsp_hle, "Core", "DSPHLE");
|
SaveCheckBox(m_use_dsp_hle, "Core", "DSPHLE");
|
||||||
|
SaveCheckBox(m_manual_texture_sampling, "Video_Hacks", "FastTextureSampling", true);
|
||||||
|
|
||||||
int determinism_num = m_deterministic_dual_core->currentIndex();
|
int determinism_num = m_deterministic_dual_core->currentIndex();
|
||||||
|
|
||||||
|
@ -35,8 +35,10 @@ private:
|
|||||||
void LoadSettings();
|
void LoadSettings();
|
||||||
void SaveSettings();
|
void SaveSettings();
|
||||||
|
|
||||||
void SaveCheckBox(QCheckBox* checkbox, const std::string& section, const std::string& key);
|
void SaveCheckBox(QCheckBox* checkbox, const std::string& section, const std::string& key,
|
||||||
void LoadCheckBox(QCheckBox* checkbox, const std::string& section, const std::string& key);
|
bool reverse = false);
|
||||||
|
void LoadCheckBox(QCheckBox* checkbox, const std::string& section, const std::string& key,
|
||||||
|
bool reverse = false);
|
||||||
|
|
||||||
QString m_gameini_sys_path;
|
QString m_gameini_sys_path;
|
||||||
QString m_gameini_local_path;
|
QString m_gameini_local_path;
|
||||||
@ -48,9 +50,10 @@ private:
|
|||||||
QCheckBox* m_enable_mmu;
|
QCheckBox* m_enable_mmu;
|
||||||
QCheckBox* m_enable_fprf;
|
QCheckBox* m_enable_fprf;
|
||||||
QCheckBox* m_sync_gpu;
|
QCheckBox* m_sync_gpu;
|
||||||
QCheckBox* m_enable_fast_disc;
|
QCheckBox* m_emulate_disc_speed;
|
||||||
QCheckBox* m_use_dsp_hle;
|
QCheckBox* m_use_dsp_hle;
|
||||||
QCheckBox* m_use_monoscopic_shadows;
|
QCheckBox* m_use_monoscopic_shadows;
|
||||||
|
QCheckBox* m_manual_texture_sampling;
|
||||||
|
|
||||||
QPushButton* m_refresh_config;
|
QPushButton* m_refresh_config;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user