Skip to content

Commit

Permalink
OPENGL: Fix >1Bpp mouse cursors which do not require format conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Nov 17, 2013
1 parent 7c753d3 commit 2094bd3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions backends/graphics/opengl/opengl-graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2094bd3

Please sign in to comment.