1
0
Fork 0

Change Monoscopic Render mode to a dropdown (#6215)

This commit is contained in:
Vitor K 2022-12-23 23:17:49 -03:00 committed by GitHub
parent ae3d50f71f
commit c8ff1d744a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 47 additions and 29 deletions

View File

@ -133,8 +133,8 @@ void Config::ReadValues() {
Settings::values.texture_filter_name = Settings::values.texture_filter_name =
sdl2_config->GetString("Renderer", "texture_filter_name", "none"); sdl2_config->GetString("Renderer", "texture_filter_name", "none");
Settings::values.mono_render_left_eye = Settings::values.mono_render_option = static_cast<Settings::MonoRenderOption>(
sdl2_config->GetBoolean("Renderer", "mono_render_left_eye", true); sdl2_config->GetInteger("Renderer", "mono_render_option", 0));
Settings::values.render_3d = static_cast<Settings::StereoRenderOption>( Settings::values.render_3d = static_cast<Settings::StereoRenderOption>(
sdl2_config->GetInteger("Renderer", "render_3d", 0)); sdl2_config->GetInteger("Renderer", "render_3d", 0));
Settings::values.factor_3d = Settings::values.factor_3d =

View File

@ -167,8 +167,8 @@ render_3d =
factor_3d = factor_3d =
# Change Default Eye to Render When in Monoscopic Mode # Change Default Eye to Render When in Monoscopic Mode
# 0 (default): Right, 1: Left # 0 (default): Left, 1: Right
mono_render_left_eye = mono_render_option =
# The name of the post processing shader to apply. # The name of the post processing shader to apply.
# Loaded from shaders if render_3d is off or side by side. # Loaded from shaders if render_3d is off or side by side.

View File

@ -483,7 +483,7 @@ void Config::ReadLayoutValues() {
ReadGlobalSetting(Settings::values.upright_screen); ReadGlobalSetting(Settings::values.upright_screen);
if (global) { if (global) {
ReadBasicSetting(Settings::values.mono_render_left_eye); ReadBasicSetting(Settings::values.mono_render_option);
ReadBasicSetting(Settings::values.custom_layout); ReadBasicSetting(Settings::values.custom_layout);
ReadBasicSetting(Settings::values.custom_top_left); ReadBasicSetting(Settings::values.custom_top_left);
ReadBasicSetting(Settings::values.custom_top_top); ReadBasicSetting(Settings::values.custom_top_top);
@ -991,7 +991,7 @@ void Config::SaveLayoutValues() {
WriteGlobalSetting(Settings::values.upright_screen); WriteGlobalSetting(Settings::values.upright_screen);
if (global) { if (global) {
WriteBasicSetting(Settings::values.mono_render_left_eye); WriteBasicSetting(Settings::values.mono_render_option);
WriteBasicSetting(Settings::values.custom_layout); WriteBasicSetting(Settings::values.custom_layout);
WriteBasicSetting(Settings::values.custom_top_left); WriteBasicSetting(Settings::values.custom_top_left);
WriteBasicSetting(Settings::values.custom_top_top); WriteBasicSetting(Settings::values.custom_top_top);

View File

@ -54,7 +54,8 @@ void ConfigureEnhancements::SetConfiguration() {
ui->render_3d_combobox->setCurrentIndex( ui->render_3d_combobox->setCurrentIndex(
static_cast<int>(Settings::values.render_3d.GetValue())); static_cast<int>(Settings::values.render_3d.GetValue()));
ui->factor_3d->setValue(Settings::values.factor_3d.GetValue()); ui->factor_3d->setValue(Settings::values.factor_3d.GetValue());
ui->mono_render_left_eye->setChecked(Settings::values.mono_render_left_eye.GetValue()); ui->mono_rendering_eye->setCurrentIndex(
static_cast<int>(Settings::values.mono_render_option.GetValue()));
updateShaders(Settings::values.render_3d.GetValue()); updateShaders(Settings::values.render_3d.GetValue());
ui->toggle_linear_filter->setChecked(Settings::values.filter_mode.GetValue()); ui->toggle_linear_filter->setChecked(Settings::values.filter_mode.GetValue());
int tex_filter_idx = ui->texture_filter_combobox->findText( int tex_filter_idx = ui->texture_filter_combobox->findText(
@ -111,7 +112,8 @@ void ConfigureEnhancements::ApplyConfiguration() {
Settings::values.render_3d = Settings::values.render_3d =
static_cast<Settings::StereoRenderOption>(ui->render_3d_combobox->currentIndex()); static_cast<Settings::StereoRenderOption>(ui->render_3d_combobox->currentIndex());
Settings::values.factor_3d = ui->factor_3d->value(); Settings::values.factor_3d = ui->factor_3d->value();
Settings::values.mono_render_left_eye = ui->mono_render_left_eye->isChecked(); Settings::values.mono_render_option =
static_cast<Settings::MonoRenderOption>(ui->mono_rendering_eye->currentIndex());
Settings::values.pp_shader_name = Settings::values.pp_shader_name =
ui->shader_combobox->itemText(ui->shader_combobox->currentIndex()).toStdString(); ui->shader_combobox->itemText(ui->shader_combobox->currentIndex()).toStdString();
Settings::values.filter_mode = ui->toggle_linear_filter->isChecked(); Settings::values.filter_mode = ui->toggle_linear_filter->isChecked();

View File

@ -210,15 +210,26 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QCheckBox" name="mono_render_left_eye"> <widget class="QLabel" name="label_6">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If false, right eye will be used. Useful if using ReShade&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text"> <property name="text">
<string>Render Left Eye in Monoscopic Mode</string> <string>Eye to Render in Monoscopic Mode</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QComboBox" name="mono_rendering_eye">
<item>
<property name="text">
<string>Left Eye (default)</string>
</property>
</item>
<item>
<property name="text">
<string>Right Eye</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -369,7 +380,7 @@
<tabstop>texture_filter_combobox</tabstop> <tabstop>texture_filter_combobox</tabstop>
<tabstop>render_3d_combobox</tabstop> <tabstop>render_3d_combobox</tabstop>
<tabstop>factor_3d</tabstop> <tabstop>factor_3d</tabstop>
<tabstop>mono_render_left_eye</tabstop> <tabstop>mono_rendering_eye</tabstop>
<tabstop>layout_combobox</tabstop> <tabstop>layout_combobox</tabstop>
<tabstop>swap_screen</tabstop> <tabstop>swap_screen</tabstop>
<tabstop>upright_screen</tabstop> <tabstop>upright_screen</tabstop>

View File

@ -109,7 +109,7 @@ void LogSettings() {
log_setting("Renderer_TextureFilterName", values.texture_filter_name.GetValue()); log_setting("Renderer_TextureFilterName", values.texture_filter_name.GetValue());
log_setting("Stereoscopy_Render3d", values.render_3d.GetValue()); log_setting("Stereoscopy_Render3d", values.render_3d.GetValue());
log_setting("Stereoscopy_Factor3d", values.factor_3d.GetValue()); log_setting("Stereoscopy_Factor3d", values.factor_3d.GetValue());
log_setting("Stereoscopy_MonoRenderLeftEye", values.mono_render_left_eye.GetValue()); log_setting("Stereoscopy_MonoRenderOption", values.mono_render_option.GetValue());
log_setting("Layout_LayoutOption", values.layout_option.GetValue()); log_setting("Layout_LayoutOption", values.layout_option.GetValue());
log_setting("Layout_SwapScreen", values.swap_screen.GetValue()); log_setting("Layout_SwapScreen", values.swap_screen.GetValue());
log_setting("Layout_UprightScreen", values.upright_screen.GetValue()); log_setting("Layout_UprightScreen", values.upright_screen.GetValue());

View File

@ -52,6 +52,10 @@ enum class StereoRenderOption : u32 {
CardboardVR = 5 CardboardVR = 5
}; };
// Which eye to render when 3d is off. 800px wide mode could be added here in the future, when
// implemented
enum class MonoRenderOption : u32 { LeftEye = 0, RightEye = 1 };
enum class AudioEmulation : u32 { HLE = 0, LLE = 1, LLEMultithreaded = 2 }; enum class AudioEmulation : u32 { HLE = 0, LLE = 1, LLEMultithreaded = 2 };
namespace NativeButton { namespace NativeButton {
@ -467,8 +471,9 @@ struct Values {
SwitchableSetting<StereoRenderOption> render_3d{StereoRenderOption::Off, "render_3d"}; SwitchableSetting<StereoRenderOption> render_3d{StereoRenderOption::Off, "render_3d"};
SwitchableSetting<u32> factor_3d{0, "factor_3d"}; SwitchableSetting<u32> factor_3d{0, "factor_3d"};
SwitchableSetting<MonoRenderOption> mono_render_option{MonoRenderOption::LeftEye,
"mono_render_option"};
Setting<bool> mono_render_left_eye{false, "mono_render_left_eye"};
Setting<s32> cardboard_screen_size{85, "cardboard_screen_size"}; Setting<s32> cardboard_screen_size{85, "cardboard_screen_size"};
Setting<s32> cardboard_x_shift{0, "cardboard_x_shift"}; Setting<s32> cardboard_x_shift{0, "cardboard_x_shift"};
Setting<s32> cardboard_y_shift{0, "cardboard_y_shift"}; Setting<s32> cardboard_y_shift{0, "cardboard_y_shift"};

View File

@ -149,8 +149,8 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) {
static_cast<int>(Settings::values.render_3d.GetValue())); static_cast<int>(Settings::values.render_3d.GetValue()));
AddField(Telemetry::FieldType::UserConfig, "Renderer_Factor3d", AddField(Telemetry::FieldType::UserConfig, "Renderer_Factor3d",
Settings::values.factor_3d.GetValue()); Settings::values.factor_3d.GetValue());
AddField(Telemetry::FieldType::UserConfig, "Renderer_MonoRenderLeftEye", AddField(Telemetry::FieldType::UserConfig, "Renderer_MonoRenderOption",
Settings::values.mono_render_left_eye.GetValue()); static_cast<int>(Settings::values.mono_render_option.GetValue()));
AddField(Telemetry::FieldType::UserConfig, "System_IsNew3ds", AddField(Telemetry::FieldType::UserConfig, "System_IsNew3ds",
Settings::values.is_new_3ds.GetValue()); Settings::values.is_new_3ds.GetValue());
AddField(Telemetry::FieldType::UserConfig, "System_RegionValue", AddField(Telemetry::FieldType::UserConfig, "System_RegionValue",

View File

@ -1005,7 +1005,7 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
if (layout.top_screen_enabled) { if (layout.top_screen_enabled) {
if (layout.is_rotated) { if (layout.is_rotated) {
if (Settings::values.render_3d.GetValue() == Settings::StereoRenderOption::Off) { if (Settings::values.render_3d.GetValue() == Settings::StereoRenderOption::Off) {
int eye = Settings::values.mono_render_left_eye ? 0 : 1; int eye = static_cast<int>(Settings::values.mono_render_option.GetValue());
DrawSingleScreenRotated(screen_infos[eye], (float)top_screen.left, DrawSingleScreenRotated(screen_infos[eye], (float)top_screen.left,
(float)top_screen.top, (float)top_screen.GetWidth(), (float)top_screen.top, (float)top_screen.GetWidth(),
(float)top_screen.GetHeight()); (float)top_screen.GetHeight());
@ -1037,7 +1037,7 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
} }
} else { } else {
if (Settings::values.render_3d.GetValue() == Settings::StereoRenderOption::Off) { if (Settings::values.render_3d.GetValue() == Settings::StereoRenderOption::Off) {
int eye = Settings::values.mono_render_left_eye.GetValue() ? 0 : 1; int eye = static_cast<int>(Settings::values.mono_render_option.GetValue());
DrawSingleScreen(screen_infos[eye], (float)top_screen.left, (float)top_screen.top, DrawSingleScreen(screen_infos[eye], (float)top_screen.left, (float)top_screen.top,
(float)top_screen.GetWidth(), (float)top_screen.GetHeight()); (float)top_screen.GetWidth(), (float)top_screen.GetHeight());
} else if (Settings::values.render_3d.GetValue() == } else if (Settings::values.render_3d.GetValue() ==