[SDL] Easy answers

Vaclav Slavik slavik2 at czn.cz
Mon Aug 16 01:14:06 PDT 1999


rival games wrote:

> I really enjoy all this talk about scrolling methods, because I am
> currently working on a super metroid like engine, you can click onto my
> url at the bottom to read more about this [open source project], but I
> have a question...
>
> How can I blit something with a certain tint? I'm in 640x480 by 16 bit
> color, so how can I (quickly) draw a sprite with a say.. blue tint. And
> how could I draw it so all the non-transparent pixels are white? Is
> there an easy way, or will I have to modify some of the SDL code?
> Thanks.

I'd recommend storing sprites as 8bit palettized images (probably in some
native, non-SDL structure), together with several palettes (normal, blue tint,
red tint, etc.). Each sprite would have associated palette in one byte and if
you change this value from, say, PAL_NORMAL to PAL_TINTED and redraw the sprite,
different palette would be used...

AFAIK this is not supported by SDL itself, so you have to write your own
routines.

Vasek






More information about the SDL mailing list