Showing changes from revision #4 to #5:
Added | Removed | Changed
These flags are used with OS_SpriteOp 52 (Paint Sprite Scaled), OS_SpriteOp 56 (Plot Sprite Transformed), and OS_SpriteOp 65 (Tile Sprite Scaled).
Flag bits | |
---|---|
0-2 | GCOL action |
3 | Use sprite mask/alpha channel |
4 | Translation table can be ignored |
5 | Translation table is wide |
6 | Enable dithering |
7 | R7 is a pointer to a Colour Mapping Descriptor |
8-15 | Translucency (0 = opaque, 255 = 1/256 visibility) |
If bit 3 is clear, the sprite mask/alpha channel will be ignored and all pixels of the sprite will be rendered. If the sprite and screen have an alpha channel then the alpha channel of the sprite will be copied to the alpha channel of the screen.
If bit 3 is set, the sprite mask/alpha channel will be used to determine which pixels to render and which pixels to skip. If the sprite has an alpha mask or alpha channel then this will enable alpha blending.
If translucency is enabled (flag bits 8-15) or alpha blending is enabled (flag bit 3 set, and the sprite has an alpha mask or alpha channel) then the GCOL action will be ignored.
It is recommended to set bit 4 whenever an ordinary translation table is supplied; i.e. a table which merely converts the colours from one palette/colour depth to another. This allows OS_SpriteOp to ignore the table in certain situations in which it believes it can produce higher quality output itself, e.g. by reading directly from the sprite palette. If you are applying a custom transform in the translation table (e.g. the table was created with the help of a colour mapping function) then bit 4 must be left clear otherwise the table may be incorrectly discarded.
Bit 5 must be set whenever bit 4 was set in the ColourTrans_SelectTable/ColourTrans_GenerateTable flags. Likewise, bit 5 must be clear if that bit was not set.
If dithering is enabled by bit 6, an ordered dither will be applied where possible. For example when painting a 16bpp or 32bpp sprite to a lower depth destination. Dithering may also be used in some situations to improve the output of blending operations.
It is only valid to set bit 7 if the source sprite is a true colour sprite (i.e. not palletised). palettised). For colour mapping of palletised palettised sprites you should instead pass the colour mapping function to ColourTrans.