From e6080087c8453b5a0345bf62b2cd3809e46f7591 Mon Sep 17 00:00:00 2001 From: dhewg Date: Thu, 24 Mar 2011 18:54:49 +0100 Subject: ANDROID: Fix cursor's keycolor Don't wipe the RGB bits, fixes wrong colors on BASS cursors --- backends/platform/android/gfx.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'backends') diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index e32e2095bc..bbd09ad20a 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -710,7 +710,9 @@ void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h, WRITE_UINT16(p, READ_UINT16(p) | 1); _mouse_keycolor = keycolor; - WRITE_UINT16(_mouse_texture_palette->palette() + keycolor * 2, 0); + + p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; + WRITE_UINT16(p, READ_UINT16(p) & ~1); } if (w == 0 || h == 0) @@ -761,7 +763,8 @@ void OSystem_Android::setCursorPaletteInternal(const byte *colors, for (uint i = 0; i < num; ++i, colors += 3, p += 2) WRITE_UINT16(p, pf.RGBToColor(colors[0], colors[1], colors[2])); - WRITE_UINT16(_mouse_texture_palette->palette() + _mouse_keycolor * 2, 0); + p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; + WRITE_UINT16(p, READ_UINT16(p) & ~1); } void OSystem_Android::setCursorPalette(const byte *colors, @@ -804,7 +807,8 @@ void OSystem_Android::disableCursorPalette(bool disable) { WRITE_UINT16(dst, pf_dst.RGBToColor(r, g, b)); } - WRITE_UINT16(_mouse_texture_palette->palette() + _mouse_keycolor * 2, 0); + byte *p = _mouse_texture_palette->palette() + _mouse_keycolor * 2; + WRITE_UINT16(p, READ_UINT16(p) & ~1); } _use_mouse_palette = !disable; -- cgit v1.2.3