summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Widescreen.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2024-10-16 02:39:23 +0100
committerTillmann Karras <tilkax@gmail.com>2024-10-16 18:36:00 +0100
commit0e41adb7b733e037afe53c30bb3b513bd37436ca (patch)
treeed5d1ff64b1e0e488a8c81eeae4e03b046110fc1 /Source/Core/VideoCommon/Widescreen.cpp
parent904ac5592daf7adc0013110da60a706b21c5d72d (diff)
VideoCommon: fix -Wshadow-uncaptured-local warning and simplify
Diffstat (limited to 'Source/Core/VideoCommon/Widescreen.cpp')
-rw-r--r--Source/Core/VideoCommon/Widescreen.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/Widescreen.cpp b/Source/Core/VideoCommon/Widescreen.cpp
index cfb10ad479..21309f3a98 100644
--- a/Source/Core/VideoCommon/Widescreen.cpp
+++ b/Source/Core/VideoCommon/Widescreen.cpp
@@ -15,9 +15,8 @@ std::unique_ptr<WidescreenManager> g_widescreen;
WidescreenManager::WidescreenManager()
{
- std::optional<bool> is_game_widescreen = GetWidescreenOverride();
- if (is_game_widescreen.has_value())
- m_is_game_widescreen = is_game_widescreen.value();
+ if (std::optional<bool> is_game_widescreen = GetWidescreenOverride())
+ m_is_game_widescreen = *is_game_widescreen;
// Throw a warning as unsupported aspect ratio modes have no specific behavior to them
const bool is_valid_suggested_aspect_mode =
@@ -34,14 +33,13 @@ WidescreenManager::WidescreenManager()
[this](u32 bits) {
if (bits & (CONFIG_CHANGE_BIT_ASPECT_RATIO))
{
- std::optional<bool> is_game_widescreen = GetWidescreenOverride();
// If the widescreen flag isn't being overridden by any settings,
// reset it to default if heuristic aren't running or to the last
// heuristic value if they were running.
- if (!is_game_widescreen.has_value())
- is_game_widescreen = (m_heuristic_state == HeuristicState::Active_Found_Anamorphic);
- if (is_game_widescreen.has_value())
- m_is_game_widescreen = is_game_widescreen.value();
+ if (std::optional<bool> is_game_widescreen = GetWidescreenOverride())
+ m_is_game_widescreen = *is_game_widescreen;
+ else
+ m_is_game_widescreen = (m_heuristic_state == HeuristicState::Active_Found_Anamorphic);
}
},
"Widescreen");