diff options
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r-- | backends/graphics/opengl/debug.cpp | 4 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 11 | ||||
-rw-r--r-- | backends/graphics/opengl/texture.cpp | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/backends/graphics/opengl/debug.cpp b/backends/graphics/opengl/debug.cpp index 69006bb975..d5d73fb5ec 100644 --- a/backends/graphics/opengl/debug.cpp +++ b/backends/graphics/opengl/debug.cpp @@ -52,9 +52,9 @@ Common::String getGLErrStr(GLenum error) { } // End of anonymous namespace void checkGLError(const char *expr, const char *file, int line) { - GLenum error = glGetError(); + GLenum error; - if (error != GL_NO_ERROR) { + while ((error = glGetError()) != GL_NO_ERROR) { // We cannot use error here because we do not know whether we have a // working screen or not. warning("GL ERROR: %s on %s (%s:%d)", getGLErrStr(error).c_str(), expr, file, line); diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 9ad0e62f37..a97f680f15 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -608,13 +608,10 @@ void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int Graphics::Surface *dst = _cursor->getSurface(); const uint srcPitch = w * inputFormat.bytesPerPixel; - // In case the actual cursor format differs from the requested format - // we will need to convert the format. This might be the case because - // the cursor format does not have any alpha bits. - if (dst->format != inputFormat) { - Graphics::crossBlit((byte *)dst->getPixels(), (const byte *)buf, dst->pitch, srcPitch, - w, h, dst->format, inputFormat); - } + // Copy the cursor data to the actual texture surface. This will make + // sure that the data is also converted to the expected format. + Graphics::crossBlit((byte *)dst->getPixels(), (const byte *)buf, dst->pitch, srcPitch, + w, h, dst->format, inputFormat); // We apply the color key by setting the alpha bits of the pixels to // fully transparent. diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp index 917bf70534..8f17ed7eeb 100644 --- a/backends/graphics/opengl/texture.cpp +++ b/backends/graphics/opengl/texture.cpp @@ -287,7 +287,7 @@ void TextureCLUT8::allocate(uint width, uint height) { // We only need to reinitialize our CLUT8 surface when the output size // changed. - if (width == _clut8Data.w && width == _clut8Data.h) { + if (width == _clut8Data.w && height == _clut8Data.h) { return; } |