[Scummvm-devel] 16bit alpha blending

Marcus Comstedt marcus at mc.pp.se
Sun Feb 20 18:01:44 CET 2011


Johannes Schickel <lordhoto at scummvm.org> writes:

> I am not sure whether we should really allow more alpha blending on the 
> cursor surface than either drawing a pixel (full alpha) or not drawing 
> it (alpha is zero). That of course still requires some checking by the 
> backend that the cursor surface data does not use alpha values in 
> between. On the other hand IIRC even the 16bpp engines are using a 
> colorkey for the cursor at the moment.
>
> Since there is currently no engine (that I am aware of), which wants to 
> take advantage of an alpha value on the cursor, it feels like over 
> engineering if we would add support for multiple blending modes now.

Well, for now we could say that

1) only max (~0) or min (0) alpha is allowed (trivially fulfilled for
   ARGB1555 :)
2) a pixel with min alpha must have all colour channels (RGB) set to
   0 as well

In this case it doesn't matter if the backend uses pre-multiplied
alpha or not, the result will be the same.

I don't think the backend should really spend time actually checking
this, except possibly as some kind of lint mode (implemented in some
commonly used backend) to help find engine bugs.


  // Marcus






More information about the Scummvm-devel mailing list