VideoCommon: Mark framedump variables as private.

And rename them to the new naming scheme.
This commit is contained in:
degasus 2016-10-07 21:39:23 +02:00
parent e82cf46436
commit 8c999f9ee8
2 changed files with 24 additions and 23 deletions

View File

@ -113,10 +113,10 @@ Renderer::~Renderer()
#if defined(HAVE_LIBAV) || defined(_WIN32) #if defined(HAVE_LIBAV) || defined(_WIN32)
// Stop frame dumping if it was left enabled at shutdown time. // Stop frame dumping if it was left enabled at shutdown time.
if (bAVIDumping) if (m_AVI_dumping)
{ {
AVIDump::Stop(); AVIDump::Stop();
bAVIDumping = false; m_AVI_dumping = false;
} }
#endif #endif
} }
@ -542,15 +542,15 @@ bool Renderer::IsFrameDumping()
if (SConfig::GetInstance().m_DumpFrames) if (SConfig::GetInstance().m_DumpFrames)
return true; return true;
if (bLastFrameDumped && bAVIDumping) if (m_last_frame_dumped && m_AVI_dumping)
{ {
AVIDump::Stop(); AVIDump::Stop();
std::vector<u8>().swap(frame_data); std::vector<u8>().swap(m_frame_data);
m_last_framedump_width = m_last_framedump_height = 0; m_last_framedump_width = m_last_framedump_height = 0;
bAVIDumping = false; m_AVI_dumping = false;
OSD::AddMessage("Stop dumping frames", 2000); OSD::AddMessage("Stop dumping frames", 2000);
} }
bLastFrameDumped = false; m_last_frame_dumped = false;
#endif #endif
return false; 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. // TODO: Refactor this. Right now it's needed for the implace flipping of the image.
// It's also used to repeat the last frame. // 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); m_AVI_dumping = AVIDump::Start(w, h, format);
if (!bAVIDumping) if (!m_AVI_dumping)
{ {
OSD::AddMessage("AVIDump Start failed", 2000); OSD::AddMessage("AVIDump Start failed", 2000);
} }
@ -595,23 +595,23 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat f
2000); 2000);
} }
} }
if (bAVIDumping) if (m_AVI_dumping)
{ {
if (swap_upside_down) if (swap_upside_down)
FlipImageData(&frame_data[0], w, h, 4); FlipImageData(m_frame_data.data(), w, h, 4);
AVIDump::AddFrame(&frame_data[0], w, h); AVIDump::AddFrame(m_frame_data.data(), w, h);
} }
bLastFrameDumped = true; m_last_frame_dumped = true;
#endif #endif
} }
void Renderer::RepeatFrameDumpFrame() void Renderer::RepeatFrameDumpFrame()
{ {
#if defined(HAVE_LIBAV) || defined(_WIN32) #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 #endif
} }

View File

@ -156,13 +156,6 @@ protected:
static std::mutex s_criticalScreenshot; static std::mutex s_criticalScreenshot;
static std::string s_sScreenshotName; static std::string s_sScreenshotName;
std::vector<u8> 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 // The framebuffer size
static int s_target_width; static int s_target_width;
static int s_target_height; static int s_target_height;
@ -194,6 +187,14 @@ private:
static unsigned int efb_scale_numeratorY; static unsigned int efb_scale_numeratorY;
static unsigned int efb_scale_denominatorX; static unsigned int efb_scale_denominatorX;
static unsigned int efb_scale_denominatorY; static unsigned int efb_scale_denominatorY;
// framedumping
std::vector<u8> 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<Renderer> g_renderer; extern std::unique_ptr<Renderer> g_renderer;