Skip to content

Commit

Permalink
IPHONE: Use the proper RGBA5551 palette for the mouse cursor.
Browse files Browse the repository at this point in the history
Formerly the overlay cursor was using a RGB565 palette, even though the
texture is really set up as RGBA5551.
  • Loading branch information
Johannes Schickel committed Feb 19, 2012
1 parent ceae3dd commit 87d85a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backends/platform/iphone/osys_main.h
Expand Up @@ -70,7 +70,10 @@ class OSystem_IPHONE : public EventsBaseBackend, public PaletteManager {

uint16 *_fullscreen;

// For use with the game texture
uint16 _gamePalette[256];
// For use with the mouse texture
uint16 _gamePaletteRGBA5551[256];
bool _overlayVisible;
uint16 _screenWidth;
uint16 _screenHeight;
Expand Down
3 changes: 2 additions & 1 deletion backends/platform/iphone/osys_video.cpp
Expand Up @@ -99,6 +99,7 @@ void OSystem_IPHONE::setPalette(const byte *colors, uint start, uint num) {

for (uint i = start; i < start + num; ++i) {
_gamePalette[i] = Graphics::RGBToColor<Graphics::ColorMasks<565> >(b[0], b[1], b[2]);
_gamePaletteRGBA5551[i] = Graphics::RGBToColor<Graphics::ColorMasks<5551> >(b[0], b[1], b[2]);
b += 3;
}

Expand Down Expand Up @@ -473,7 +474,7 @@ void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspot
for (uint y = 0; y < h; ++y) {
byte color = buf[y * w + x];
if (color != keycolor)
mouseBuf[y * texWidth + x] = _gamePalette[color] | 0x1;
mouseBuf[y * texWidth + x] = _gamePaletteRGBA5551[color] | 0x1;
else
mouseBuf[y * texWidth + x] = 0x0;
}
Expand Down

0 comments on commit 87d85a7

Please sign in to comment.