diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 1ba81ecf2b..1dd07c905b 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -113,10 +113,10 @@ Renderer::~Renderer() #if defined(HAVE_LIBAV) || defined(_WIN32) // Stop frame dumping if it was left enabled at shutdown time. - if (bAVIDumping) + if (m_AVI_dumping) { AVIDump::Stop(); - bAVIDumping = false; + m_AVI_dumping = false; } #endif } @@ -542,15 +542,15 @@ bool Renderer::IsFrameDumping() if (SConfig::GetInstance().m_DumpFrames) return true; - if (bLastFrameDumped && bAVIDumping) + if (m_last_frame_dumped && m_AVI_dumping) { AVIDump::Stop(); - std::vector().swap(frame_data); + std::vector().swap(m_frame_data); m_last_framedump_width = m_last_framedump_height = 0; - bAVIDumping = false; + m_AVI_dumping = false; OSD::AddMessage("Stop dumping frames", 2000); } - bLastFrameDumped = false; + m_last_frame_dumped = false; #endif return false; } @@ -579,12 +579,12 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat f // TODO: Refactor this. Right now it's needed for the implace flipping of the image. // It's also used to repeat the last frame. - frame_data.assign(data, data + image_size); + m_frame_data.assign(data, data + image_size); - if (!bLastFrameDumped) + if (!m_last_frame_dumped) { - bAVIDumping = AVIDump::Start(w, h, format); - if (!bAVIDumping) + m_AVI_dumping = AVIDump::Start(w, h, format); + if (!m_AVI_dumping) { OSD::AddMessage("AVIDump Start failed", 2000); } @@ -595,23 +595,23 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat f 2000); } } - if (bAVIDumping) + if (m_AVI_dumping) { if (swap_upside_down) - FlipImageData(&frame_data[0], w, h, 4); - AVIDump::AddFrame(&frame_data[0], w, h); + FlipImageData(m_frame_data.data(), w, h, 4); + AVIDump::AddFrame(m_frame_data.data(), w, h); } - bLastFrameDumped = true; + m_last_frame_dumped = true; #endif } void Renderer::RepeatFrameDumpFrame() { #if defined(HAVE_LIBAV) || defined(_WIN32) - if (SConfig::GetInstance().m_DumpFrames && bAVIDumping && !frame_data.empty()) + if (SConfig::GetInstance().m_DumpFrames && m_AVI_dumping && !m_frame_data.empty()) { - AVIDump::AddFrame(&frame_data[0], m_last_framedump_width, m_last_framedump_height); + AVIDump::AddFrame(m_frame_data.data(), m_last_framedump_width, m_last_framedump_height); } #endif } diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h index 27a8dfa089..1f648bb17b 100644 --- a/Source/Core/VideoCommon/RenderBase.h +++ b/Source/Core/VideoCommon/RenderBase.h @@ -156,13 +156,6 @@ protected: static std::mutex s_criticalScreenshot; static std::string s_sScreenshotName; - std::vector frame_data; - bool bAVIDumping = false; - bool bLastFrameDumped = false; - int m_last_framedump_width = 0; - int m_last_framedump_height = 0; - AVIDump::DumpFormat m_last_framedump_format; - // The framebuffer size static int s_target_width; static int s_target_height; @@ -194,6 +187,14 @@ private: static unsigned int efb_scale_numeratorY; static unsigned int efb_scale_denominatorX; static unsigned int efb_scale_denominatorY; + + // framedumping + std::vector m_frame_data; + bool m_AVI_dumping = false; + bool m_last_frame_dumped = false; + int m_last_framedump_width = 0; + int m_last_framedump_height = 0; + AVIDump::DumpFormat m_last_framedump_format; }; extern std::unique_ptr g_renderer;