From 87d85a7b20c611898bbb4c714b40de5691a8d8ff Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Feb 2012 22:19:38 +0100 Subject: IPHONE: Use the proper RGBA5551 palette for the mouse cursor. Formerly the overlay cursor was using a RGB565 palette, even though the texture is really set up as RGBA5551. --- backends/platform/iphone/osys_main.h | 3 +++ backends/platform/iphone/osys_video.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'backends') diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index b89eed9d43..c63ba41319 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -70,7 +70,10 @@ protected: 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; diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp index c97b6757ea..3b14126234 100644 --- a/backends/platform/iphone/osys_video.cpp +++ b/backends/platform/iphone/osys_video.cpp @@ -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 >(b[0], b[1], b[2]); + _gamePaletteRGBA5551[i] = Graphics::RGBToColor >(b[0], b[1], b[2]); b += 3; } @@ -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; } -- cgit v1.2.3