summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2016-10-08 15:28:12 +0200
committerdegasus <wickmarkus@web.de>2016-10-08 15:44:54 +0200
commit0864ef435219dbbded3b07a8159a85731e605087 (patch)
treea2d7453ae1962185d119c7f0a818f41d0fbba00d /Source/Core/VideoCommon/RenderBase.cpp
parent1ef5ba0c53fc82017dbe9ec745e7eb2765a928ed (diff)
VideoCommon: Add custom stride for framedumping.
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 6f1a581b6e..e523fd8a67 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -555,30 +555,20 @@ bool Renderer::IsFrameDumping()
return false;
}
-void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat format,
+void Renderer::DumpFrameData(const u8* data, int w, int h, int stride, AVIDump::DumpFormat format,
bool swap_upside_down)
{
#if defined(HAVE_LIBAV) || defined(_WIN32)
if (w == 0 || h == 0)
return;
- size_t image_size;
- switch (format)
- {
- case AVIDump::DumpFormat::FORMAT_BGR:
- image_size = 3 * w * h;
- break;
- case AVIDump::DumpFormat::FORMAT_RGBA:
- image_size = 4 * w * h;
- break;
- }
-
m_last_framedump_width = w;
m_last_framedump_height = h;
m_last_framedump_format = format;
+ m_last_framedump_stride = stride;
// TODO: Refactor this. Right now it's needed for the implace flipping of the image.
- m_frame_data.assign(data, data + image_size);
+ m_frame_data.assign(data, data + stride * h);
if (!m_last_frame_dumped)
{
@@ -598,7 +588,7 @@ void Renderer::DumpFrameData(const u8* data, int w, int h, AVIDump::DumpFormat f
{
if (swap_upside_down)
FlipImageData(m_frame_data.data(), w, h, 4);
- AVIDump::AddFrame(m_frame_data.data(), w, h);
+ AVIDump::AddFrame(m_frame_data.data(), w, h, stride);
}
m_last_frame_dumped = true;