[Scummvm-devel] setMouseCursor() keycolor

Marcus Comstedt marcus at mc.pp.se
Fri Jan 8 20:56:38 CET 2010


D G Turner <d.g.turner at ntlworld.com> writes:

> Marcus,
>
>   That was to fix a bug which resulted in the Myst ME cursors having
>   white rather than transparent backgrounds, which occured around r833
>   i.e. 14th-16th Nov 2009.
>
>   This was traced to the keycolor, which failed to match the default
>   white due to the keycolor variable size differences between different
>   backends. Some used uint8 for keycolor, others uint32.
>
>   I corrected this and the extra 0xFF was to cover the case of the color
>   being represented with an alpha channel i.e. ARGB to stop the problem
>   reemerging if the color format had alpha added.
>
>   I'm happy with whatever you do with this, as long as the Myst ME
>   cursors still get a transparent background :-)

Let's see if I get this straight:

* You are converting the cursor image provided by the game data
  to some dynamically selected pixel format (using crossBlit?)

* The pixels which were white in the source data should be transparent
  when the cursor is displayed (meaning that no visible part of the
  cursor can be white)

Is that correct?  In that case, you should use the representation of
white of the selected pixel format as key color, i.e.

  _pixelFormat.RGBToColor(0xff, 0xff, 0xff)

That should work for any non-CLUT mode.


  // Marcus






More information about the Scummvm-devel mailing list