Video: update widescreen heuristic code to never get stuck to specific old values when changing settings

This commit is contained in:
Filoppi
2023-12-18 20:16:58 +02:00
parent 95ee0ac781
commit 48fbbdba7c
2 changed files with 91 additions and 60 deletions

View File

@ -24,12 +24,21 @@ public:
void DoState(PointerWrap& p);
private:
void Update();
enum class HeuristicState
{
Inactive,
Active_NotFound,
Active_Found_Normal,
Active_Found_Anamorphic,
};
// Returns whether the widescreen state wants to change, and its target value
std::optional<bool> GetWidescreenOverride() const;
void UpdateWidescreenHeuristic();
bool m_is_game_widescreen = false;
bool m_was_orthographically_anamorphic = false;
bool m_widescreen_heuristics_active_and_successful = false;
HeuristicState m_heuristic_state = HeuristicState::Inactive;
Common::EventHook m_update_widescreen;
Common::EventHook m_config_changed;