diff options
| author | Scott Mansell <phiren@gmail.com> | 2019-09-09 09:50:47 +1200 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2019-09-09 10:36:31 +1200 |
| commit | 46f4f69cfd62231f37b7924070a98c5d3ff4b282 (patch) | |
| tree | b1f7cd99f0b109c7dd607d2995e9cf44fdafa957 /Source/Core | |
| parent | 828dc0f204841edac628d1cb5daf72c7ceca4b9f (diff) | |
QtFifoPlayer: handle fifo load before window creation
Fixes a bug where if you loaded a fifo before opening the fifo
player window (which you can do by dragging a .dff onto dolphin's
main window) then the player's widgets wouldn't be initilized
correctly.
Importantly, the object range widgets would be broken.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/FifoPlayer/FifoPlayer.cpp | 11 | ||||
| -rw-r--r-- | Source/Core/Core/FifoPlayer/FifoPlayer.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Source/Core/Core/FifoPlayer/FifoPlayer.cpp b/Source/Core/Core/FifoPlayer/FifoPlayer.cpp index e8438f3002..5fcb2acda3 100644 --- a/Source/Core/Core/FifoPlayer/FifoPlayer.cpp +++ b/Source/Core/Core/FifoPlayer/FifoPlayer.cpp @@ -168,6 +168,17 @@ std::unique_ptr<CPUCoreBase> FifoPlayer::GetCPUCore() return std::make_unique<CPUCore>(this); } +void FifoPlayer::SetFileLoadedCallback(CallbackFunc callback) +{ + m_FileLoadedCb = callback; + + // Trigger the callback immediatly if the file is already loaded. + if (GetFile() != nullptr) + { + m_FileLoadedCb(); + } +} + bool FifoPlayer::IsRunningWithFakeVideoInterfaceUpdates() const { if (!m_File || m_File->GetFrameCount() == 0) diff --git a/Source/Core/Core/FifoPlayer/FifoPlayer.h b/Source/Core/Core/FifoPlayer/FifoPlayer.h index 48b6b5db7d..1b22eb2849 100644 --- a/Source/Core/Core/FifoPlayer/FifoPlayer.h +++ b/Source/Core/Core/FifoPlayer/FifoPlayer.h @@ -93,7 +93,7 @@ public: // Default is disabled void SetEarlyMemoryUpdates(bool enabled) { m_EarlyMemoryUpdates = enabled; } // Callbacks - void SetFileLoadedCallback(CallbackFunc callback) { m_FileLoadedCb = callback; } + void SetFileLoadedCallback(CallbackFunc callback); void SetFrameWrittenCallback(CallbackFunc callback) { m_FrameWrittenCb = callback; } static FifoPlayer& GetInstance(); |
