OPENGL: Clean up the overlay pixel format code

This commit is contained in:
Bastien Bouclet 2017-08-25 06:44:24 +02:00
parent 9853d26344
commit d645bbcefd
3 changed files with 6 additions and 7 deletions

View file

@ -155,11 +155,7 @@ void OpenGLSdlGraphicsManager::setupScreen(uint gameWidth, uint gameHeight, bool
initializeOpenGLContext(); initializeOpenGLContext();
_surfaceRenderer = OpenGL::createBestSurfaceRenderer(); _surfaceRenderer = OpenGL::createBestSurfaceRenderer();
#ifdef SCUMM_BIG_ENDIAN _overlayFormat = OpenGL::Texture::getRGBAPixelFormat();
_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
_overlayScreen = new OpenGL::TiledSurface(effectiveWidth, effectiveHeight, _overlayFormat); _overlayScreen = new OpenGL::TiledSurface(effectiveWidth, effectiveHeight, _overlayFormat);
_overlayWidth = effectiveWidth; _overlayWidth = effectiveWidth;

View file

@ -42,7 +42,7 @@ static T nextHigher2(T k) {
return k + 1; return k + 1;
} }
static const Graphics::PixelFormat getRGBAPixelFormat() { const Graphics::PixelFormat Texture::getRGBAPixelFormat() {
#ifdef SCUMM_BIG_ENDIAN #ifdef SCUMM_BIG_ENDIAN
return Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); return Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
#else #else
@ -50,7 +50,7 @@ static const Graphics::PixelFormat getRGBAPixelFormat() {
#endif #endif
} }
static const Graphics::PixelFormat get565PixelFormat() { const Graphics::PixelFormat Texture::get565PixelFormat() {
return Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); return Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
} }

View file

@ -42,6 +42,9 @@ public:
uint getTexWidth() const { return _texWidth; } uint getTexWidth() const { return _texWidth; }
uint getTexHeight() const { return _texHeight; } uint getTexHeight() const { return _texHeight; }
static const Graphics::PixelFormat getRGBAPixelFormat();
static const Graphics::PixelFormat get565PixelFormat();
protected: protected:
bool _managedTexture; bool _managedTexture;
GLuint _texture; GLuint _texture;