diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 0a1c3ca39b5..42abd39a998 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -742,10 +742,11 @@ bool OpenGLSdlGraphicsManager::saveScreenshot(const Common::String &filename) co #endif Graphics::Surface data; data.init(width, height, lineSize, &pixels.front(), format); + data.flipVertical(Common::Rect(width, height)); #ifdef USE_PNG - return Image::writePNG(out, data, true); + return Image::writePNG(out, data); #else - return Image::writeBMP(out, data, true); + return Image::writeBMP(out, data); #endif } diff --git a/image/bmp.cpp b/image/bmp.cpp index fd07ab89547..2a00cbc9d6b 100644 --- a/image/bmp.cpp +++ b/image/bmp.cpp @@ -132,8 +132,7 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) { return true; } -// ResidualVM specific argument: bottomUp -bool writeBMP(Common::WriteStream &out, const Graphics::Surface &input, const bool bottomUp) { +bool writeBMP(Common::WriteStream &out, const Graphics::Surface &input) { #ifdef SCUMM_LITTLE_ENDIAN const Graphics::PixelFormat requiredFormat_3byte(3, 8, 8, 8, 0, 16, 8, 0, 0); #else @@ -170,17 +169,10 @@ bool writeBMP(Common::WriteStream &out, const Graphics::Surface &input, const bo out.writeUint32LE(0); out.writeUint32LE(0); -// ResidualVM specific - if (bottomUp) { - for (uint y = 0; y < surface->h; ++y) { - out.write((const void *)surface->getBasePtr(0, y), dstPitch); - out.write(&padding, extraDataLength); - } - } else { - for (uint y = surface->h; y-- > 0;) { - out.write((const void *)surface->getBasePtr(0, y), dstPitch); - out.write(&padding, extraDataLength); - } + + for (uint y = surface->h; y-- > 0;) { + out.write((const void *)surface->getBasePtr(0, y), dstPitch); + out.write(&padding, extraDataLength); } // free tmp surface diff --git a/image/bmp.h b/image/bmp.h index ed166d8c3f5..2b7d6fb83fb 100644 --- a/image/bmp.h +++ b/image/bmp.h @@ -70,8 +70,7 @@ private: /** * Outputs an uncompressed BMP stream of the given input surface. */ -// ResidualVM specific argument: bottomUp -bool writeBMP(Common::WriteStream &out, const Graphics::Surface &input, const bool bottomUp = false); +bool writeBMP(Common::WriteStream &out, const Graphics::Surface &input); } // End of namespace Image diff --git a/image/png.cpp b/image/png.cpp index 43a0a13940e..307334a64ba 100644 --- a/image/png.cpp +++ b/image/png.cpp @@ -255,8 +255,7 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) { #endif } -// ResidualVM specific argument: bottomUp -bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const bool bottomUp) { +bool writePNG(Common::WriteStream &out, const Graphics::Surface &input) { #ifdef USE_PNG #ifdef SCUMM_LITTLE_ENDIAN const Graphics::PixelFormat requiredFormat_3byte(3, 8, 8, 8, 0, 0, 8, 16, 0); @@ -309,15 +308,8 @@ bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const bo Common::Array rows; rows.reserve(surface->h); -// ResidualVM specific - if (bottomUp) { - for (uint y = surface->h; y-- > 0;) { - rows.push_back((const uint8 *)surface->getBasePtr(0, y)); - } - } else { - for (uint y = 0; y < surface->h; ++y) { - rows.push_back((const uint8 *)surface->getBasePtr(0, y)); - } + for (uint y = 0; y < surface->h; ++y) { + rows.push_back((const uint8 *)surface->getBasePtr(0, y)); } png_set_rows(pngPtr, infoPtr, const_cast(&rows.front())); diff --git a/image/png.h b/image/png.h index 3b8efe20f7f..1402976963e 100644 --- a/image/png.h +++ b/image/png.h @@ -79,8 +79,7 @@ private: /** * Outputs a compressed PNG stream of the given input surface. */ -// ResidualVM specific argument: bottomUp -bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const bool bottomUp = false); +bool writePNG(Common::WriteStream &out, const Graphics::Surface &input); } // End of namespace Image