From d49f3a8a781b28ba46e22e8f8a2c486a146b7e8c Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 7 Mar 2011 00:53:40 -0500 Subject: GRAPHICS: Improve support of Windows 8bpp cursors --- graphics/wincursor.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'graphics/wincursor.cpp') diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp index 2f3f29d8a0..15ae69e2f1 100644 --- a/graphics/wincursor.cpp +++ b/graphics/wincursor.cpp @@ -161,9 +161,22 @@ bool WinCursor::readFromStream(Common::SeekableReadStream &stream) { // If we're not using the maximum colors in a byte, we can fit it in _keyColor = numColors; } else { - // TODO - warning("Handle 8bpp cursors with all colors"); - return false; + // HACK: Try to find a color that's not being used so it can become + // our keycolor. It's quite impossible to fit 257 entries into 256... + for (uint32 i = 0; i < 256; i++) { + for (int j = 0; j < _width * _height; j++) { + // TODO: Also check to see if the space is transparent + + if (_surface[j] == i) + break; + + if (j == _width * _height - 1) { + _keyColor = i; + i = 256; + break; + } + } + } } // Now go through and apply the AND map to get the transparency -- cgit v1.2.3