aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohannes Schickel2014-02-12 18:06:29 +0100
committerJohannes Schickel2014-02-12 18:06:29 +0100
commit5d78542ab8c6a76e266a453b8590bf6bbd70b631 (patch)
tree2918291f4eab0dcdd800e34f07cd9431e8ee31e6 /backends
parent2cab30ee80a7611945ac5e9260c63d6b86f658cf (diff)
downloadscummvm-rg350-5d78542ab8c6a76e266a453b8590bf6bbd70b631.tar.gz
scummvm-rg350-5d78542ab8c6a76e266a453b8590bf6bbd70b631.tar.bz2
scummvm-rg350-5d78542ab8c6a76e266a453b8590bf6bbd70b631.zip
OPENGL: Always support RGBA8888 (memory layout).
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index d7d37a2025..0a034128fe 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -918,7 +918,16 @@ Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &forma
}
bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const {
- if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565
+#ifdef SCUMM_LITTLE_ENDIAN
+ if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888
+#else
+ if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888
+#endif
+ glIntFormat = GL_RGBA;
+ glFormat = GL_RGBA;
+ glType = GL_UNSIGNED_BYTE;
+ return true;
+ } else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565
glIntFormat = GL_RGB;
glFormat = GL_RGB;
glType = GL_UNSIGNED_SHORT_5_6_5;
@@ -934,11 +943,13 @@ bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelF
glType = GL_UNSIGNED_SHORT_4_4_4_4;
return true;
#ifndef USE_GLES
+#ifdef SCUMM_LITTLE_ENDIAN
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_INT_8_8_8_8;
return true;
+#endif
} else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555
// GL_BGRA does not exist in every GLES implementation so should not be configured if
// USE_GLES is set.
@@ -956,11 +967,13 @@ bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelF
glFormat = GL_BGRA;
glType = GL_UNSIGNED_SHORT_4_4_4_4_REV;
return true;
+#ifdef SCUMM_BIG_ENDIAN
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888
glIntFormat = GL_RGBA;
glFormat = GL_RGBA;
glType = GL_UNSIGNED_INT_8_8_8_8_REV;
return true;
+#endif
} else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0)) { // BGRA8888
glIntFormat = GL_RGBA;
glFormat = GL_BGRA;