aboutsummaryrefslogtreecommitdiff
path: root/graphics/wincursor.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-03-07 00:53:40 -0500
committerMatthew Hoops2011-03-07 00:53:40 -0500
commitd49f3a8a781b28ba46e22e8f8a2c486a146b7e8c (patch)
treee8387857ac52302e5f58d032b70b748a35bf3acd /graphics/wincursor.cpp
parent6582b77f1c3c6f373d2aa3a55f30c254f5f0e244 (diff)
downloadscummvm-rg350-d49f3a8a781b28ba46e22e8f8a2c486a146b7e8c.tar.gz
scummvm-rg350-d49f3a8a781b28ba46e22e8f8a2c486a146b7e8c.tar.bz2
scummvm-rg350-d49f3a8a781b28ba46e22e8f8a2c486a146b7e8c.zip
GRAPHICS: Improve support of Windows 8bpp cursors
Diffstat (limited to 'graphics/wincursor.cpp')
-rw-r--r--graphics/wincursor.cpp19
1 files changed, 16 insertions, 3 deletions
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