citra, citra_qt, settings.h, default_ini.h: Add option for interlaced 3D

This commit is contained in:
iwubcode 2019-12-06 01:43:06 -06:00
parent cd86c9b043
commit 6f269c375f
6 changed files with 27 additions and 13 deletions

View file

@ -131,10 +131,13 @@ void Config::ReadValues() {
sdl2_config->GetInteger("Renderer", "render_3d", 0)); sdl2_config->GetInteger("Renderer", "render_3d", 0));
Settings::values.factor_3d = Settings::values.factor_3d =
static_cast<u8>(sdl2_config->GetInteger("Renderer", "factor_3d", 0)); static_cast<u8>(sdl2_config->GetInteger("Renderer", "factor_3d", 0));
Settings::values.pp_shader_name = sdl2_config->GetString( std::string default_shader = "none (builtin)";
"Renderer", "pp_shader_name", if (Settings::values.render_3d == Settings::StereoRenderOption::Anaglyph)
(Settings::values.render_3d == Settings::StereoRenderOption::Anaglyph) ? "dubois (builtin)" default_shader = "dubois (builtin)";
: "none (builtin)"); else if (Settings::values.render_3d == Settings::StereoRenderOption::Interlaced)
default_shader = "horizontal (builtin)";
Settings::values.pp_shader_name =
sdl2_config->GetString("Renderer", "pp_shader_name", default_shader);
Settings::values.filter_mode = sdl2_config->GetBoolean("Renderer", "filter_mode", true); Settings::values.filter_mode = sdl2_config->GetBoolean("Renderer", "filter_mode", true);
Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0)); Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0));

View file

@ -137,7 +137,7 @@ bg_blue =
bg_green = bg_green =
# Whether and how Stereoscopic 3D should be rendered # Whether and how Stereoscopic 3D should be rendered
# 0 (default): Off, 1: Side by Side, 2: Anaglyph # 0 (default): Off, 1: Side by Side, 2: Anaglyph, 3: Interlaced
render_3d = render_3d =
# Change 3D Intensity # Change 3D Intensity

View file

@ -21,8 +21,7 @@ ConfigureEnhancements::ConfigureEnhancements(QWidget* parent)
connect(ui->render_3d_combobox, connect(ui->render_3d_combobox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
[this](int currentIndex) { [this](int currentIndex) {
updateShaders(static_cast<Settings::StereoRenderOption>(currentIndex) == updateShaders(static_cast<Settings::StereoRenderOption>(currentIndex));
Settings::StereoRenderOption::Anaglyph);
}); });
connect(ui->bg_button, &QPushButton::clicked, this, [this] { connect(ui->bg_button, &QPushButton::clicked, this, [this] {
@ -49,7 +48,7 @@ void ConfigureEnhancements::SetConfiguration() {
ui->resolution_factor_combobox->setCurrentIndex(Settings::values.resolution_factor); ui->resolution_factor_combobox->setCurrentIndex(Settings::values.resolution_factor);
ui->render_3d_combobox->setCurrentIndex(static_cast<int>(Settings::values.render_3d)); ui->render_3d_combobox->setCurrentIndex(static_cast<int>(Settings::values.render_3d));
ui->factor_3d->setValue(Settings::values.factor_3d); ui->factor_3d->setValue(Settings::values.factor_3d);
updateShaders(Settings::values.render_3d == Settings::StereoRenderOption::Anaglyph); updateShaders(Settings::values.render_3d);
ui->toggle_linear_filter->setChecked(Settings::values.filter_mode); ui->toggle_linear_filter->setChecked(Settings::values.filter_mode);
ui->layout_combobox->setCurrentIndex(static_cast<int>(Settings::values.layout_option)); ui->layout_combobox->setCurrentIndex(static_cast<int>(Settings::values.layout_option));
ui->swap_screen->setChecked(Settings::values.swap_screen); ui->swap_screen->setChecked(Settings::values.swap_screen);
@ -64,17 +63,20 @@ void ConfigureEnhancements::SetConfiguration() {
ui->bg_button->setIcon(color_icon); ui->bg_button->setIcon(color_icon);
} }
void ConfigureEnhancements::updateShaders(bool anaglyph) { void ConfigureEnhancements::updateShaders(Settings::StereoRenderOption stereo_option) {
ui->shader_combobox->clear(); ui->shader_combobox->clear();
if (anaglyph) if (stereo_option == Settings::StereoRenderOption::Anaglyph)
ui->shader_combobox->addItem("dubois (builtin)"); ui->shader_combobox->addItem("dubois (builtin)");
else if (stereo_option == Settings::StereoRenderOption::Interlaced)
ui->shader_combobox->addItem("horizontal (builtin)");
else else
ui->shader_combobox->addItem("none (builtin)"); ui->shader_combobox->addItem("none (builtin)");
ui->shader_combobox->setCurrentIndex(0); ui->shader_combobox->setCurrentIndex(0);
for (const auto& shader : OpenGL::GetPostProcessingShaderList(anaglyph)) { for (const auto& shader : OpenGL::GetPostProcessingShaderList(
stereo_option == Settings::StereoRenderOption::Anaglyph)) {
ui->shader_combobox->addItem(QString::fromStdString(shader)); ui->shader_combobox->addItem(QString::fromStdString(shader));
if (Settings::values.pp_shader_name == shader) if (Settings::values.pp_shader_name == shader)
ui->shader_combobox->setCurrentIndex(ui->shader_combobox->count() - 1); ui->shader_combobox->setCurrentIndex(ui->shader_combobox->count() - 1);

View file

@ -6,6 +6,10 @@
#include <QWidget> #include <QWidget>
namespace Settings {
enum class StereoRenderOption;
}
namespace Ui { namespace Ui {
class ConfigureEnhancements; class ConfigureEnhancements;
} }
@ -22,7 +26,7 @@ public:
void SetConfiguration(); void SetConfiguration();
private: private:
void updateShaders(bool anaglyph); void updateShaders(Settings::StereoRenderOption stereo_option);
Ui::ConfigureEnhancements* ui; Ui::ConfigureEnhancements* ui;
QColor bg_color; QColor bg_color;

View file

@ -152,6 +152,11 @@
<string>Anaglyph</string> <string>Anaglyph</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>Interlaced</string>
</property>
</item>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -32,7 +32,7 @@ enum class MicInputType {
Static, Static,
}; };
enum class StereoRenderOption { Off, SideBySide, Anaglyph }; enum class StereoRenderOption { Off, SideBySide, Anaglyph, Interlaced };
namespace NativeButton { namespace NativeButton {
enum Values { enum Values {