diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 97c6d6d624e..e1a0ea145bf 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -155,11 +155,7 @@ void OpenGLSdlGraphicsManager::setupScreen(uint gameWidth, uint gameHeight, bool initializeOpenGLContext(); _surfaceRenderer = OpenGL::createBestSurfaceRenderer(); -#ifdef SCUMM_BIG_ENDIAN - _overlayFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); -#else - _overlayFormat = Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24); -#endif + _overlayFormat = OpenGL::Texture::getRGBAPixelFormat(); _overlayScreen = new OpenGL::TiledSurface(effectiveWidth, effectiveHeight, _overlayFormat); _overlayWidth = effectiveWidth; diff --git a/graphics/opengl/texture.cpp b/graphics/opengl/texture.cpp index 2906567a4a6..5e3acad8793 100644 --- a/graphics/opengl/texture.cpp +++ b/graphics/opengl/texture.cpp @@ -42,7 +42,7 @@ static T nextHigher2(T k) { return k + 1; } -static const Graphics::PixelFormat getRGBAPixelFormat() { +const Graphics::PixelFormat Texture::getRGBAPixelFormat() { #ifdef SCUMM_BIG_ENDIAN return Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); #else @@ -50,7 +50,7 @@ static const Graphics::PixelFormat getRGBAPixelFormat() { #endif } -static const Graphics::PixelFormat get565PixelFormat() { +const Graphics::PixelFormat Texture::get565PixelFormat() { return Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); } diff --git a/graphics/opengl/texture.h b/graphics/opengl/texture.h index 040f69361ba..bfe3247470a 100644 --- a/graphics/opengl/texture.h +++ b/graphics/opengl/texture.h @@ -42,6 +42,9 @@ public: uint getTexWidth() const { return _texWidth; } uint getTexHeight() const { return _texHeight; } + static const Graphics::PixelFormat getRGBAPixelFormat(); + static const Graphics::PixelFormat get565PixelFormat(); + protected: bool _managedTexture; GLuint _texture;