[Scummvm-devel] setMouseCursor() keycolor

Marcus Comstedt marcus at mc.pp.se
Thu Jan 7 02:23:01 CET 2010


Johannes Schickel <lordhoto at scummvm.org> writes:

> Probably the default value was changed to 0xFFFFFFFF, so that an
> engine author has not as many nasty surprises as with a default value
> of 255 (which would be always a different color in RGB bit depths).

Why would a default value of white be less nasty than a default value
of blueish, or whatever 255 would be in the pixel mode the engine has
selected?  The change seems to _cause_ nasty surpises (for engines
which expected the default to be 255 like before) rather than prevent
any.


> [...] I'm not arguing that this makes any sense, [...]

Good.  :-)


> Well we need a big enough type to allow the function to be used for
> generic bit depths. In the end when the user violates that it it
> should be undefined what is happening (like your backend does now
> ;-). If we really need cursor without a transparency color, we should
> use some bool to indicate that. Now thinking of any cursor which
> doesn't have any transparency looks weird.... thus just stating that
> the color should fit in the format set up is sane and
> non-surprising. We might just make the SDL backend assert, in case
> it's violated to enforce this on the usual development platforms.

An assertion is certainly better than undefined behaviour, since
undefined behaviour can hide bugs, just like the behaviour of the SDL
backend did in this case.


  // Marcus






More information about the Scummvm-devel mailing list