Revert "Merge pull request #7361 from hrydgard/color-conv-centralize"

This reverts commit f1b57dabf5, reversing
changes made to 41001637ce.
This commit is contained in:
Henrik Rydgard committed 2015-01-22 19:53:32 +01:00
1 parent 07933cad42
commit cae58cafee
33 files changed
+1195 -476

No files matched your search

+9 -9
View File
@@ -23,7 +23,6 @@
#endif
#include "Common/FileUtil.h"
#include "Common/ColorConv.h"
#include "Core/Config.h"
#include "Core/Screenshot.h"
#include "GPU/Common/GPUDebugInterface.h"
@@ -49,7 +48,8 @@ public:
}
}
bool put_buf(const void *buf, int len) override {
bool put_buf(const void *buf, int len) override
{
if (fp_) {
if (fwrite(buf, len, 1, fp_) != 1) {
fclose(fp_);
@@ -149,13 +149,14 @@ static const u8 *ConvertBufferTo888RGB(const GPUDebugBuffer &buf, u8 *&temp) {
const u16 *buf16 = (const u16 *)buffer;
const u32 *buf32 = (const u32 *)buffer;
for (u32 y = 0; y < buf.GetHeight(); y++) {
u8 *dst;
if (flip) {
dst = &temp[(buf.GetHeight() - y - 1) * buf.GetStride() * 3];
} else {
dst = &temp[y * buf.GetStride() * 3];
}
for (u32 x = 0; x < buf.GetStride(); x++) {
u8 *dst;
if (flip) {
dst = &temp[(buf.GetHeight() - y - 1) * buf.GetStride() * 3 + x * 3];
} else {
dst = &temp[y * buf.GetStride() * 3 + x * 3];
}
u8 &r = brswap ? dst[2] : dst[0];
u8 &g = dst[1];
u8 &b = brswap ? dst[0] : dst[2];
@@ -202,7 +203,6 @@ static const u8 *ConvertBufferTo888RGB(const GPUDebugBuffer &buf, u8 *&temp) {
ERROR_LOG(COMMON, "Unsupported framebuffer format for screenshot: %d", buf.GetFormat());
return nullptr;
}
dst += 3;
}
}
buffer = temp;