2023-01-31 04:58:54 +00:00
|
|
|
// Copyright 2023 Dolphin Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "VideoCommon/VideoConfig.h"
|
|
|
|
#include "VideoCommon/VideoEvents.h"
|
|
|
|
|
|
|
|
class PointerWrap;
|
|
|
|
|
|
|
|
// This class is responsible for tracking the game's aspect ratio.
|
2023-09-09 12:48:37 +00:00
|
|
|
// This exclusively supports 4:3 or 16:9 detection by default.
|
2023-01-31 04:58:54 +00:00
|
|
|
class WidescreenManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WidescreenManager();
|
|
|
|
|
2023-09-09 12:48:37 +00:00
|
|
|
// Just a helper to tell whether the game seems to be running in widescreen,
|
|
|
|
// or if it's being forced to.
|
2023-01-31 04:58:54 +00:00
|
|
|
bool IsGameWidescreen() const { return m_is_game_widescreen; }
|
|
|
|
|
|
|
|
void DoState(PointerWrap& p);
|
2023-01-31 06:21:15 +00:00
|
|
|
|
2023-01-31 04:58:54 +00:00
|
|
|
private:
|
|
|
|
void Update();
|
|
|
|
void UpdateWidescreenHeuristic();
|
|
|
|
|
|
|
|
bool m_is_game_widescreen = false;
|
|
|
|
bool m_was_orthographically_anamorphic = false;
|
2024-02-20 00:42:52 +00:00
|
|
|
bool m_widescreen_heuristics_active_and_successful = false;
|
2023-01-31 04:58:54 +00:00
|
|
|
|
2023-02-03 00:18:37 +00:00
|
|
|
Common::EventHook m_update_widescreen;
|
|
|
|
Common::EventHook m_config_changed;
|
2023-01-31 04:58:54 +00:00
|
|
|
};
|
|
|
|
|
2023-01-31 06:21:15 +00:00
|
|
|
extern std::unique_ptr<WidescreenManager> g_widescreen;
|