[SDL] Blitting on 8 bit surfaces
Christian Meyer
tvgenial at web.de
Wed Dec 26 05:53:57 PST 2007
Sylvain Beucler schrieb:
> Hi,
>
> On Sun, Dec 23, 2007 at 11:27:56AM +0100, Christian Meyer wrote:
>> Thanks for your answer :)
>>
>> In my spezial case, I have surfaces where some indices have a spezial
>> meaning (e. g. marks areas where an animations will be displayed).
>>
>> So if I understood this correctly, I have to do the following:
>>
>> When all pixels with index n should be unchaged, I have to make sure,
>> that n points to the same RGB-value in both palettes.
>
> I think this may not always work. For example, maybe the destination
> palette has the same RGB-value than index 'n' _twice_: at index 'n'
> and at another index. In that case, maybe the other index will be used.
>
> I'm not sure if there's an easy way to do that using BlitSurface. If
> you only work with 8bit surfaces, maybe you could easily implement
> your own Blit function (see
> http://www.libsdl.org/cgi/docwiki.cgi/Pixel_20Access).
>
>> When the color of a pixel should be unchanged, I just have to make sure,
>> that the RGB-Value exists in the dest palette.
>
> This should work :)
>
Yes, I think implementing my own blit function will be the easiest way.
Thanks yor your help, and merry Christmas :)
More information about the SDL
mailing list