From 14e39697365dee10962014568f63ae3e7f663400 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 26 Jan 2024 14:30:41 +1000 Subject: [PATCH] Misc: Warning fixes --- src/core/cpu_code_cache.cpp | 5 +++++ src/core/fullscreen_ui.cpp | 9 +++++++-- src/core/gpu_hw.cpp | 27 ++++++++++++++++----------- src/core/negcon.cpp | 2 +- src/util/imgui_manager.cpp | 2 +- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index 0e650837e..1ae296213 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -242,9 +242,14 @@ void CPU::CodeCache::Execute() { #ifdef ENABLE_RECOMPILER_SUPPORT if (IsUsingAnyRecompiler()) + { g_enter_recompiler(); + UnreachableCode(); + } else + { ExecuteCachedInterpreter(); + } #else ExecuteCachedInterpreter(); #endif diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index 9d4663f77..af84582d0 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -6205,7 +6205,7 @@ void FullscreenUI::DrawGameListSettingsPage(const ImVec2& heading_size) } } - MenuHeading("List Settings"); + MenuHeading(FSUI_CSTR("List Settings")); { static constexpr const char* view_types[] = {FSUI_NSTR("Game Grid"), FSUI_NSTR("Game List")}; static constexpr const char* sort_types[] = { @@ -6234,14 +6234,18 @@ void FullscreenUI::DrawGameListSettingsPage(const ImVec2& heading_size) } } - MenuHeading("Operations"); + MenuHeading(FSUI_CSTR("Operations")); { if (MenuButton(FSUI_ICONSTR(ICON_FA_SEARCH, "Scan For New Games"), FSUI_CSTR("Identifies any new files added to the game directories."))) + { Host::RefreshGameListAsync(false); + } if (MenuButton(FSUI_ICONSTR(ICON_FA_SEARCH_PLUS, "Rescan All Games"), FSUI_CSTR("Forces a full rescan of all games previously identified."))) + { Host::RefreshGameListAsync(true); + } } EndMenuButtons(); @@ -6772,6 +6776,7 @@ TRANSLATE_NOOP("FullscreenUI", "Leaderboard Notifications"); TRANSLATE_NOOP("FullscreenUI", "Leaderboards"); TRANSLATE_NOOP("FullscreenUI", "Leaderboards are not enabled."); TRANSLATE_NOOP("FullscreenUI", "Limits how many frames are displayed to the screen. These frames are still rendered."); +TRANSLATE_NOOP("FullscreenUI", "List Settings"); TRANSLATE_NOOP("FullscreenUI", "Load Devices From Save States"); TRANSLATE_NOOP("FullscreenUI", "Load Profile"); TRANSLATE_NOOP("FullscreenUI", "Load Resume State"); diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index d8f81fff4..193812bf7 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -346,10 +346,10 @@ void GPU_HW::UpdateSettings(const Settings& old_settings) g_settings.gpu_downsample_scale != old_settings.gpu_downsample_scale)); const bool shaders_changed = (m_resolution_scale != resolution_scale || m_multisamples != multisamples || - m_true_color != g_settings.gpu_true_color || m_debanding != g_settings.gpu_debanding || m_per_sample_shading != per_sample_shading || - m_scaled_dithering != g_settings.gpu_scaled_dithering || m_texture_filtering != g_settings.gpu_texture_filter || - m_clamp_uvs != clamp_uvs || m_chroma_smoothing != g_settings.gpu_24bit_chroma_smoothing || - m_downsample_mode != downsample_mode || + m_true_color != g_settings.gpu_true_color || m_debanding != g_settings.gpu_debanding || + m_per_sample_shading != per_sample_shading || m_scaled_dithering != g_settings.gpu_scaled_dithering || + m_texture_filtering != g_settings.gpu_texture_filter || m_clamp_uvs != clamp_uvs || + m_chroma_smoothing != g_settings.gpu_24bit_chroma_smoothing || m_downsample_mode != downsample_mode || (m_downsample_mode == GPUDownsampleMode::Box && g_settings.gpu_downsample_scale != old_settings.gpu_downsample_scale) || m_wireframe_mode != wireframe_mode || m_pgxp_depth_buffer != g_settings.UsingPGXPDepthBuffer() || @@ -527,11 +527,14 @@ u32 GPU_HW::CalculateResolutionScale() const (NTSC_VERTICAL_ACTIVE_END - NTSC_VERTICAL_ACTIVE_START)); float widescreen_multiplier = 1.0f; - if (g_settings.gpu_widescreen_hack) { - // Multiply scale factor by aspect ratio relative to 4:3, so that widescreen resolution is as close as possible to native screen resolution. - // Otherwise, anamorphic stretching would result in increasingly less horizontal resolution (relative to native screen resolution) - // as the aspect ratio gets wider. - widescreen_multiplier = std::max(1.0, (float(g_gpu_device->GetWindowWidth()) / g_gpu_device->GetWindowHeight()) / (4.0 / 3.0)); + if (g_settings.gpu_widescreen_hack) + { + // Multiply scale factor by aspect ratio relative to 4:3, so that widescreen resolution is as close as possible to + // native screen resolution. Otherwise, anamorphic stretching would result in increasingly less horizontal + // resolution (relative to native screen resolution) as the aspect ratio gets wider. + widescreen_multiplier = std::max(1.0f, (static_cast(g_gpu_device->GetWindowWidth()) / + static_cast(g_gpu_device->GetWindowHeight())) / + (4.0f / 3.0f)); } const s32 preferred_scale = @@ -615,7 +618,8 @@ void GPU_HW::PrintSettingsToLog() VRAM_HEIGHT * m_resolution_scale, GetMaxResolutionScale()); Log_InfoFmt("Multisampling: {}x{}", m_multisamples, m_per_sample_shading ? " (per sample shading)" : ""); Log_InfoFmt("Dithering: {}{}", m_true_color ? "Disabled" : "Enabled", - (!m_true_color && m_scaled_dithering) ? " (Scaled)" : ((m_true_color && m_debanding) ? " (Debanding)" : "")); + (!m_true_color && m_scaled_dithering) ? " (Scaled)" : + ((m_true_color && m_debanding) ? " (Debanding)" : "")); Log_InfoFmt("Texture Filtering: {}", Settings::GetTextureFilterDisplayName(m_texture_filtering)); Log_InfoFmt("Dual-source blending: {}", m_supports_dual_source_blend ? "Supported" : "Not supported"); Log_InfoFmt("Clamping UVs: {}", m_clamp_uvs ? "YES" : "NO"); @@ -709,7 +713,8 @@ bool GPU_HW::CompilePipelines() const GPUDevice::Features features = g_gpu_device->GetFeatures(); GPU_HW_ShaderGen shadergen(g_gpu_device->GetRenderAPI(), m_resolution_scale, m_multisamples, m_per_sample_shading, m_true_color, m_scaled_dithering, m_texture_filtering, m_clamp_uvs, m_pgxp_depth_buffer, - m_disable_color_perspective, m_supports_dual_source_blend, m_supports_framebuffer_fetch, m_debanding); + m_disable_color_perspective, m_supports_dual_source_blend, m_supports_framebuffer_fetch, + m_debanding); ShaderCompileProgressTracker progress("Compiling Pipelines", 2 + (4 * 5 * 9 * 2 * 2) + (3 * 4 * 5 * 9 * 2 * 2) + 1 + 2 + (2 * 2) + 2 + 1 + 1 + (2 * 3) + 1); diff --git a/src/core/negcon.cpp b/src/core/negcon.cpp index 2ce198863..66e27c904 100644 --- a/src/core/negcon.cpp +++ b/src/core/negcon.cpp @@ -93,7 +93,7 @@ static float apply_axis_modifier(float value, const NeGcon::AxisModifier& axis_m static u8 get_scaled_value(float value, const NeGcon::AxisModifier& axis_modifier) { value = axis_modifier.scaling * axis_modifier.unit * value + axis_modifier.zero; - return std::clamp(std::round(value), 0.0f, 255.0f); + return static_cast(std::clamp(std::round(value), 0.0f, 255.0f)); } void NeGcon::SetBindState(u32 index, float value) diff --git a/src/util/imgui_manager.cpp b/src/util/imgui_manager.cpp index b8aa5fafb..1a6b529ff 100644 --- a/src/util/imgui_manager.cpp +++ b/src/util/imgui_manager.cpp @@ -560,7 +560,7 @@ bool ImGuiManager::AddIconFonts(float size) 0xf019, 0xf019, 0xf01c, 0xf01c, 0xf021, 0xf021, 0xf023, 0xf023, 0xf025, 0xf025, 0xf027, 0xf028, 0xf02e, 0xf02e, 0xf030, 0xf030, 0xf03a, 0xf03a, 0xf03d, 0xf03d, 0xf049, 0xf04c, 0xf050, 0xf050, 0xf059, 0xf059, 0xf05e, 0xf05e, 0xf062, 0xf063, 0xf065, 0xf065, 0xf067, 0xf067, 0xf071, 0xf071, 0xf075, 0xf075, 0xf077, 0xf078, 0xf07b, 0xf07c, - 0xf084, 0xf085, 0xf091, 0xf091, 0xf0a0, 0xf0a0, 0xf0ac, 0xf0ad, 0xf0c5, 0xf0c5, 0xf0c7, 0xf0c8, 0xf0cb, 0xf0cb, + 0xf084, 0xf085, 0xf091, 0xf091, 0xf0a0, 0xf0a0, 0xf0ac, 0xf0ad, 0xf0c5, 0xf0c5, 0xf0c7, 0xf0c9, 0xf0cb, 0xf0cb, 0xf0d0, 0xf0d0, 0xf0dc, 0xf0dc, 0xf0e2, 0xf0e2, 0xf0eb, 0xf0eb, 0xf0f1, 0xf0f1, 0xf0f3, 0xf0f3, 0xf0fe, 0xf0fe, 0xf110, 0xf110, 0xf119, 0xf119, 0xf11b, 0xf11c, 0xf140, 0xf140, 0xf144, 0xf144, 0xf14a, 0xf14a, 0xf15b, 0xf15b, 0xf15d, 0xf15d, 0xf188, 0xf188, 0xf191, 0xf192, 0xf1ab, 0xf1ab, 0xf1dd, 0xf1de, 0xf1e6, 0xf1e6, 0xf1eb, 0xf1eb,