[SDL] showing bitmaps ( 32bitpngs -> 8 bit surface )

neil at cloudsprinter.com neil at cloudsprinter.com
Fri Apr 4 08:33:02 PDT 2008


Quoting "hinko.kocevar at cetrtapot.si" <hinko.kocevar at cetrtapot.si>:

> Ken Rogoway wrote:
>> If I understand you correctly you want multiple bmps on the screen at the
>> same time and your screen resolution is 8bpp?
>
> Correct.
>
> If that is the case you will
>> need to pre-process your bmp files so they all have a common palette.
>
> I see. I was afraid of that.
>

i have similar issues creating a low colour version of my game using the
existing high colour gfx png's.

if the surface is 8bit then all images have to share the same pallette as the
screen surface to display images, good dithering when converting can produce
effective results, but i think just converting them to bmp is a bit of a slack
ware way of making sure they work ok.

i have attempted this.. ( and failed )

1) get a base pallette image (8bit), load it and use its pallete to then load
all other pngs into 8 bit surface

2) use imagemajic to convert all my high colour images using a base pallette (
means duplicate gfx and might as well be to bmp )

3) load all my pngs into 32 bit surfaces then convert them to 8bit surfaces
using a specified pallete. ( same as 1 ? ?!? )


dont have the code to hand on how i tried this, but i'm sure it was very, very
wrong..




More information about the SDL mailing list