mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
MYST3: Fix the endian-safety of the OpenGL texture loading
This commit is contained in:
parent
24b6e643b4
commit
7a3e61a9b7
@ -368,7 +368,7 @@ Graphics::Surface *OpenGLRenderer::getScreenshot() {
|
||||
Graphics::Surface *s = new Graphics::Surface();
|
||||
s->create(screen.width(), screen.height(), Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
|
||||
|
||||
glReadPixels(screen.left, screen.top, screen.width(), screen.height(), GL_RGBA, GL_UNSIGNED_BYTE, s->getPixels());
|
||||
glReadPixels(screen.left, screen.top, screen.width(), screen.height(), GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, s->getPixels());
|
||||
|
||||
flipVertical(s);
|
||||
|
||||
|
@ -437,7 +437,7 @@ Graphics::Surface *ShaderRenderer::getScreenshot() {
|
||||
Graphics::Surface *s = new Graphics::Surface();
|
||||
s->create(screen.width(), screen.height(), Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
|
||||
|
||||
glReadPixels(screen.left, screen.top, screen.width(), screen.height(), GL_RGBA, GL_UNSIGNED_BYTE, s->getPixels());
|
||||
glReadPixels(screen.left, screen.top, screen.width(), screen.height(), GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, s->getPixels());
|
||||
|
||||
flipVertical(s);
|
||||
|
||||
|
@ -56,7 +56,7 @@ OpenGLTexture::OpenGLTexture(const Graphics::Surface *surface, bool nonPoTSuppor
|
||||
|
||||
if (format.bytesPerPixel == 4) {
|
||||
internalFormat = GL_RGBA;
|
||||
sourceFormat = GL_UNSIGNED_BYTE;
|
||||
sourceFormat = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
} else if (format.bytesPerPixel == 2) {
|
||||
internalFormat = GL_RGB;
|
||||
sourceFormat = GL_UNSIGNED_SHORT_5_6_5;
|
||||
|
Loading…
x
Reference in New Issue
Block a user