diff options
| author | Lioncash <mathew1800@gmail.com> | 2016-09-21 18:53:13 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2016-09-21 20:56:44 -0400 |
| commit | 33288c4569de2cb41150778f622573237afed39b (patch) | |
| tree | 98e927e8e0a1ba3d1458879764c0c50ee5433092 /Source/Core/VideoBackends/Software/DebugUtil.cpp | |
| parent | 023eb34247f4e3db924113dd524615d3d05d8992 (diff) | |
EfbInterface: Change out parameters on getters to return by value
Diffstat (limited to 'Source/Core/VideoBackends/Software/DebugUtil.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/DebugUtil.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp index 4d0d73137e..bb85ef4fd5 100644 --- a/Source/Core/VideoBackends/Software/DebugUtil.cpp +++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp @@ -2,13 +2,17 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "VideoBackends/Software/DebugUtil.h" + +#include <cstring> + +#include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/StringUtil.h" #include "Core/ConfigManager.h" -#include "VideoBackends/Software/DebugUtil.h" #include "VideoBackends/Software/EfbInterface.h" #include "VideoBackends/Software/SWRenderer.h" #include "VideoBackends/Software/TextureSampler.h" @@ -133,18 +137,16 @@ static void DumpEfb(const std::string& filename) { u8* data = new u8[EFB_WIDTH * EFB_HEIGHT * 4]; u8* writePtr = data; - u8 sample[4]; for (int y = 0; y < EFB_HEIGHT; y++) { for (int x = 0; x < EFB_WIDTH; x++) { - EfbInterface::GetColor(x, y, sample); // ABGR to RGBA - *(writePtr++) = sample[3]; - *(writePtr++) = sample[2]; - *(writePtr++) = sample[1]; - *(writePtr++) = sample[0]; + const u32 sample = Common::swap32(EfbInterface::GetColor(x, y)); + + std::memcpy(writePtr, &sample, sizeof(u32)); + writePtr += sizeof(u32); } } |
