This commit is contained in:
Megamouse 2026-04-08 12:44:18 +02:00 committed by GitHub
commit 3d8e6111ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 10 deletions

View File

@ -524,19 +524,11 @@ error_code cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<f32> screenSize)
{
// Return Playstation 3D display value
// Some games call this function when 3D is enabled
*screenSize = 24.f;
*screenSize = static_cast<f32>(g_cfg.video.screen_size.get());
return CELL_OK;
}
// TODO: Use virtual screen size
#ifdef _WIN32
// HDC screen = GetDC(NULL);
// float diagonal = roundf(sqrtf((powf(float(GetDeviceCaps(screen, HORZSIZE)), 2) + powf(float(GetDeviceCaps(screen, VERTSIZE)), 2))) * 0.0393f);
#else
// TODO: Linux implementation, without using wx
// float diagonal = roundf(sqrtf((powf(wxGetDisplaySizeMM().GetWidth(), 2) + powf(wxGetDisplaySizeMM().GetHeight(), 2))) * 0.0393f);
#endif
// Let's just return not set for now
return CELL_VIDEO_OUT_ERROR_VALUE_IS_NOT_SET;
}

View File

@ -157,6 +157,7 @@ struct cfg_root : cfg::node
cfg::_bool force_hw_MSAA_resolve{ this, "Force Hardware MSAA Resolve", false, true };
cfg::_bool stereo_enabled{ this, "3D Display Enabled", false };
cfg::_enum<stereo_render_mode_options> stereo_render_mode{ this, "3D Display Mode", stereo_render_mode_options::disabled, true };
cfg::_int<10, 99> screen_size{ this, "Screen size in inches", 24, false };
cfg::_bool debug_program_analyser{ this, "Debug Program Analyser", false };
cfg::_bool precise_zpass_count{ this, "Accurate ZCULL stats", true };
cfg::_int<1, 8> consecutive_frames_to_draw{ this, "Consecutive Frames To Draw", 1, true};

View File

@ -82,6 +82,7 @@ enum class emu_settings_type
ShaderPrecisionQuality,
StereoRenderEnabled,
StereoRenderMode,
ScreenSize,
AnisotropicFilterOverride,
TextureLodBias,
ResolutionScale,
@ -295,6 +296,7 @@ inline static const std::map<emu_settings_type, cfg_location> settings_location
{ emu_settings_type::DisableFIFOReordering, { "Video", "Disable FIFO Reordering"}},
{ emu_settings_type::StereoRenderEnabled, { "Video", "3D Display Enabled"}},
{ emu_settings_type::StereoRenderMode, { "Video", "3D Display Mode"}},
{ emu_settings_type::ScreenSize, { "Video", "Screen size in inches"}},
{ emu_settings_type::StrictTextureFlushing, { "Video", "Strict Texture Flushing"}},
{ emu_settings_type::ForceCPUBlitEmulation, { "Video", "Force CPU Blit"}},
{ emu_settings_type::DisableOnDiskShaderCache, { "Video", "Disable On-Disk Shader Cache"}},

View File

@ -581,6 +581,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
// 3D
m_emu_settings->EnhanceComboBox(ui->stereoRenderMode, emu_settings_type::StereoRenderMode);
m_emu_settings->EnhanceCheckBox(ui->stereoRenderEnabled, emu_settings_type::StereoRenderEnabled);
m_emu_settings->EnhanceSpinBox(ui->sb_screen_size, emu_settings_type::ScreenSize);
SubscribeTooltip(ui->gb_stereo, tooltips.settings.stereo_render_mode);
if (game)
{
@ -591,6 +592,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
const bool stereo_enabled = ui->stereoRenderEnabled->checkState() == Qt::CheckState::Checked;
ui->stereoRenderMode->setEnabled(stereo_allowed && stereo_enabled);
ui->stereoRenderEnabled->setEnabled(stereo_allowed);
ui->gb_screen_size->setEnabled(stereo_allowed && stereo_enabled);
};
connect(ui->resBox, &QComboBox::currentIndexChanged, this, [enable_3D_modes](int){ enable_3D_modes(); });
connect(ui->stereoRenderEnabled, &QCheckBox::checkStateChanged, this, [enable_3D_modes](Qt::CheckState){ enable_3D_modes(); });

View File

@ -557,6 +557,18 @@
<item>
<widget class="QComboBox" name="stereoRenderMode"/>
</item>
<item>
<widget class="QGroupBox" name="gb_screen_size">
<property name="title">
<string>Screen Size (Inch)</string>
</property>
<layout class="QVBoxLayout" name="layout_gb_screen_size">
<item>
<widget class="QSpinBox" name="sb_screen_size"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>