fix texture dumping on opengl es, create load folder if none exists if custom textures is enabled

This commit is contained in:
Khangaroo 2019-08-08 16:55:36 -04:00 committed by James Rowe
parent 254f8a4643
commit f09489475a
2 changed files with 9 additions and 43 deletions

View file

@ -922,7 +922,11 @@ void CachedSurface::DumpTexture(GLuint target_tex, const std::string& dump_path)
std::vector<u8> decoded_texture;
decoded_texture.resize(width * height * 4);
glBindTexture(GL_TEXTURE_2D, target_tex);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, &decoded_texture[0]);
if (GLES)
GetTexImageOES(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, height, width, 0,
&decoded_texture[0]);
else
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, &decoded_texture[0]);
glBindTexture(GL_TEXTURE_2D, 0);
Common::FlipRGBA8Texture(decoded_texture, width, height);
if (!image_interface->EncodePNG(dump_path, decoded_texture, width, height))