summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-01-13 13:14:48 +0100
committerAdmiral H. Curtiss <pikachu025@gmail.com>2024-01-15 08:05:30 +0100
commit95cba6be2beda7fbf4fb597b0aa4cbb8912d8265 (patch)
tree30c854ca14e32320334914d6c48e4f99e0a17233 /Source/Core/VideoCommon
parentc76dee7807c331582cfb36376329e760eab3f704 (diff)
Core/Movie: Refactor to class, move to System.
A bit of global state remains (the `header` in `BeginRecordingInput()`) due to unclear lifetime requirements.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/OnScreenUI.cpp24
-rw-r--r--Source/Core/VideoCommon/VideoConfig.cpp5
2 files changed, 16 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/OnScreenUI.cpp b/Source/Core/VideoCommon/OnScreenUI.cpp
index fdb5d49af7..dce1c2146f 100644
--- a/Source/Core/VideoCommon/OnScreenUI.cpp
+++ b/Source/Core/VideoCommon/OnScreenUI.cpp
@@ -11,6 +11,7 @@
#include "Core/Config/MainSettings.h"
#include "Core/Config/NetplaySettings.h"
#include "Core/Movie.h"
+#include "Core/System.h"
#include "VideoCommon/AbstractGfx.h"
#include "VideoCommon/AbstractPipeline.h"
@@ -284,26 +285,27 @@ void OnScreenUI::DrawDebugText()
ImGui::GetIO().DisplaySize);
if (ImGui::Begin("Movie", nullptr, ImGuiWindowFlags_NoFocusOnAppearing))
{
- if (Movie::IsPlayingInput())
+ auto& movie = Core::System::GetInstance().GetMovie();
+ if (movie.IsPlayingInput())
{
- ImGui::Text("Frame: %" PRIu64 " / %" PRIu64, Movie::GetCurrentFrame(),
- Movie::GetTotalFrames());
- ImGui::Text("Input: %" PRIu64 " / %" PRIu64, Movie::GetCurrentInputCount(),
- Movie::GetTotalInputCount());
+ ImGui::Text("Frame: %" PRIu64 " / %" PRIu64, movie.GetCurrentFrame(),
+ movie.GetTotalFrames());
+ ImGui::Text("Input: %" PRIu64 " / %" PRIu64, movie.GetCurrentInputCount(),
+ movie.GetTotalInputCount());
}
else if (Config::Get(Config::MAIN_SHOW_FRAME_COUNT))
{
- ImGui::Text("Frame: %" PRIu64, Movie::GetCurrentFrame());
- ImGui::Text("Input: %" PRIu64, Movie::GetCurrentInputCount());
+ ImGui::Text("Frame: %" PRIu64, movie.GetCurrentFrame());
+ ImGui::Text("Input: %" PRIu64, movie.GetCurrentInputCount());
}
if (Config::Get(Config::MAIN_SHOW_LAG))
- ImGui::Text("Lag: %" PRIu64 "\n", Movie::GetCurrentLagCount());
+ ImGui::Text("Lag: %" PRIu64 "\n", movie.GetCurrentLagCount());
if (Config::Get(Config::MAIN_MOVIE_SHOW_INPUT_DISPLAY))
- ImGui::TextUnformatted(Movie::GetInputDisplay().c_str());
+ ImGui::TextUnformatted(movie.GetInputDisplay().c_str());
if (Config::Get(Config::MAIN_MOVIE_SHOW_RTC))
- ImGui::TextUnformatted(Movie::GetRTCDisplay().c_str());
+ ImGui::TextUnformatted(movie.GetRTCDisplay().c_str());
if (Config::Get(Config::MAIN_MOVIE_SHOW_RERECORD))
- ImGui::TextUnformatted(Movie::GetRerecords().c_str());
+ ImGui::TextUnformatted(movie.GetRerecords().c_str());
}
ImGui::End();
}
diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp
index daba4be9e1..51ab90fb7e 100644
--- a/Source/Core/VideoCommon/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/VideoConfig.cpp
@@ -47,8 +47,9 @@ static bool IsVSyncActive(bool enabled)
void UpdateActiveConfig()
{
- if (Movie::IsPlayingInput() && Movie::IsConfigSaved())
- Movie::SetGraphicsConfig();
+ auto& movie = Core::System::GetInstance().GetMovie();
+ if (movie.IsPlayingInput() && movie.IsConfigSaved())
+ movie.SetGraphicsConfig();
g_ActiveConfig = g_Config;
g_ActiveConfig.bVSyncActive = IsVSyncActive(g_ActiveConfig.bVSync);
}