[Scummvm-devel] setMouseCursor() keycolor

Marcus Comstedt marcus at mc.pp.se
Sat Dec 19 22:31:40 CET 2009


Hi guys.

I've got a report that mouse cursor color-keying does not work anymore
in Cruise on the DC.  That is indeed the case, but it looks to me
like an engine bug.

After the high-colour changes were committed, the keycolor parameter
to OSystem::setMouseCursor() is now an uint32, so that key colours
for deeper pixel formats can be specified.  However, Cruise passes
a keycolor of 0xffffffff, and a PixelFormat of NULL (= 8 bit CLUT).
Naturally, the pixel value 0xffffffff can not exist in an 8-bit
bitmap, so no parts of the cursor become transparent.

Looking at the SDL backend, with which the cursor actually works, it
truncates the keycolor parameter to the depth of the bitmap, in this
case discarding the top 24 bits.  But that can't be right, can it?  If
the engine wants pixel 0xff to be transparent, shouldn't it use 0xff
for the keycolor parameter?  If it specifies a keycolor that can not
exist in the bitmap, shouldn't that mean that it does not want a
keycolor, but rather want the full set of colors to be available?
I see no reason for the backend to perform this kind of masking.


  // Marcus






More information about the Scummvm-devel mailing list