OPENGL: Ensure surfaces created by saveScreenshot are the right way up

This commit is contained in:
Cameron Cawley 2019-12-19 21:22:42 +00:00 committed by Filippos Karapetis
parent ba035ac532
commit d289fa5f98
5 changed files with 13 additions and 30 deletions

View file

@ -1323,10 +1323,12 @@ bool OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const
#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
}