Merge pull request #5122 from lioncash/init

FifoPlayer: In-class initialize member variables where applicable
This commit is contained in:
Markus Wick 2017-03-21 21:00:45 +01:00 committed by GitHub
commit 9ea255c04d
6 changed files with 29 additions and 41 deletions

View File

@ -13,13 +13,9 @@
using namespace FifoFileStruct; using namespace FifoFileStruct;
FifoDataFile::FifoDataFile() : m_Flags(0) FifoDataFile::FifoDataFile() = default;
{
}
FifoDataFile::~FifoDataFile() FifoDataFile::~FifoDataFile() = default;
{
}
bool FifoDataFile::HasBrokenEFBCopies() const bool FifoDataFile::HasBrokenEFBCopies() const
{ {

View File

@ -94,8 +94,8 @@ private:
u32 m_XFRegs[XF_REGS_SIZE]; u32 m_XFRegs[XF_REGS_SIZE];
u8 m_TexMem[TEX_MEM_SIZE]; u8 m_TexMem[TEX_MEM_SIZE];
u32 m_Flags; u32 m_Flags = 0;
u32 m_Version; u32 m_Version = 0;
std::vector<FifoFrameInfo> m_Frames; std::vector<FifoFrameInfo> m_Frames;
}; };

View File

@ -31,6 +31,10 @@
bool IsPlayingBackFifologWithBrokenEFBCopies = false; bool IsPlayingBackFifologWithBrokenEFBCopies = false;
FifoPlayer::FifoPlayer() : m_Loop{SConfig::GetInstance().bLoopFifoReplay}
{
}
FifoPlayer::~FifoPlayer() FifoPlayer::~FifoPlayer()
{ {
} }
@ -205,14 +209,6 @@ FifoPlayer& FifoPlayer::GetInstance()
return instance; return instance;
} }
FifoPlayer::FifoPlayer()
: m_CurrentFrame(0), m_FrameRangeStart(0), m_FrameRangeEnd(0), m_ObjectRangeStart(0),
m_ObjectRangeEnd(10000), m_EarlyMemoryUpdates(false), m_FileLoadedCb(nullptr),
m_FrameWrittenCb(nullptr), m_File(nullptr)
{
m_Loop = SConfig::GetInstance().bLoopFifoReplay;
}
void FifoPlayer::WriteFrame(const FifoFrameInfo& frame, const AnalyzedFrameInfo& info) void FifoPlayer::WriteFrame(const FifoFrameInfo& frame, const AnalyzedFrameInfo& info)
{ {
// Core timing information // Core timing information

View File

@ -130,21 +130,21 @@ private:
bool m_Loop; bool m_Loop;
u32 m_CurrentFrame; u32 m_CurrentFrame = 0;
u32 m_FrameRangeStart; u32 m_FrameRangeStart = 0;
u32 m_FrameRangeEnd; u32 m_FrameRangeEnd = 0;
u32 m_ObjectRangeStart; u32 m_ObjectRangeStart = 0;
u32 m_ObjectRangeEnd; u32 m_ObjectRangeEnd = 10000;
bool m_EarlyMemoryUpdates; bool m_EarlyMemoryUpdates = false;
u64 m_CyclesPerFrame; u64 m_CyclesPerFrame = 0;
u32 m_ElapsedCycles; u32 m_ElapsedCycles = 0;
u32 m_FrameFifoSize; u32 m_FrameFifoSize = 0;
CallbackFunc m_FileLoadedCb; CallbackFunc m_FileLoadedCb = nullptr;
CallbackFunc m_FrameWrittenCb; CallbackFunc m_FrameWrittenCb = nullptr;
std::unique_ptr<FifoDataFile> m_File; std::unique_ptr<FifoDataFile> m_File;

View File

@ -17,11 +17,7 @@
static FifoRecorder instance; static FifoRecorder instance;
static std::recursive_mutex sMutex; static std::recursive_mutex sMutex;
FifoRecorder::FifoRecorder() FifoRecorder::FifoRecorder() : m_Ram(Memory::RAM_SIZE), m_ExRam(Memory::EXRAM_SIZE)
: m_IsRecording(false), m_WasRecording(false), m_RequestedRecordingEnd(false),
m_RecordFramesRemaining(0), m_FinishedCb(nullptr), m_File(nullptr), m_SkipNextData(true),
m_SkipFutureData(true), m_FrameEnded(false), m_Ram(Memory::RAM_SIZE),
m_ExRam(Memory::EXRAM_SIZE)
{ {
} }

View File

@ -47,20 +47,20 @@ private:
// Accessed from both GUI and video threads // Accessed from both GUI and video threads
// True if video thread should send data // True if video thread should send data
volatile bool m_IsRecording; volatile bool m_IsRecording = false;
// True if m_IsRecording was true during last frame // True if m_IsRecording was true during last frame
volatile bool m_WasRecording; volatile bool m_WasRecording = false;
volatile bool m_RequestedRecordingEnd; volatile bool m_RequestedRecordingEnd = false;
volatile s32 m_RecordFramesRemaining; volatile s32 m_RecordFramesRemaining = 0;
volatile CallbackFunc m_FinishedCb; volatile CallbackFunc m_FinishedCb = nullptr;
FifoDataFile* volatile m_File; FifoDataFile* volatile m_File = nullptr;
// Accessed only from video thread // Accessed only from video thread
bool m_SkipNextData; bool m_SkipNextData = true;
bool m_SkipFutureData; bool m_SkipFutureData = true;
bool m_FrameEnded; bool m_FrameEnded = false;
FifoFrameInfo m_CurrentFrame; FifoFrameInfo m_CurrentFrame;
std::vector<u8> m_FifoData; std::vector<u8> m_FifoData;
std::vector<u8> m_Ram; std::vector<u8> m_Ram;