mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 16:49:50 +00:00
Fix screenshots to be right side up, not crash.
This commit is contained in:
parent
b7242a617b
commit
869260087c
@ -259,7 +259,7 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
|
||||
png.format = PNG_FORMAT_RGB;
|
||||
png.width = buf.GetStride();
|
||||
png.height = buf.GetHeight();
|
||||
success = WriteScreenshotToPNG(&png, filename, 0, flipbuffer, buf.GetStride() * 3, nullptr);
|
||||
success = WriteScreenshotToPNG(&png, filename, 0, buffer, buf.GetStride() * 3, nullptr);
|
||||
png_image_free(&png);
|
||||
|
||||
if (png.warning_or_error >= 2) {
|
||||
@ -269,7 +269,7 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
|
||||
} else if (success && fmt == SCREENSHOT_JPG) {
|
||||
jpge::params params;
|
||||
params.m_quality = 90;
|
||||
success = WriteScreenshotToJPEG(filename, buf.GetStride(), buf.GetHeight(), 3, flipbuffer, params);
|
||||
success = WriteScreenshotToJPEG(filename, buf.GetStride(), buf.GetHeight(), 3, buffer, params);
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
|
@ -1913,7 +1913,8 @@ bool FramebufferManager::GetDisplayFramebuffer(GPUDebugBuffer &buffer) {
|
||||
int pw = PSP_CoreParameter().pixelWidth;
|
||||
int ph = PSP_CoreParameter().pixelHeight;
|
||||
|
||||
buffer.Allocate(pw, ph, GPU_DBG_FORMAT_888_RGB, false);
|
||||
// The backbuffer is flipped.
|
||||
buffer.Allocate(pw, ph, GPU_DBG_FORMAT_888_RGB, true);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glReadPixels(0, 0, pw, ph, GL_RGB, GL_UNSIGNED_BYTE, buffer.GetData());
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user