Advertisement

Palette question

Started by March 02, 2000 07:22 AM
2 comments, last by Bleakcabal 25 years ago
Hi, I recently asked a question about bitmaps on this forum and got help so im gonna ask another question! I am still writing my 8 bpp DirectDraw engine. I have now written a function that loads bitmaps, bitblt them on a surface and then bltfast them on the backbuffer. The problem is I can`t get the bitmap palette to work, I have tried 2 ways of accomplishing this, but none of them were sucessful. Im pretty sure the palette is loaded into bitpalette[256], but I cant seem to be able to swap the palette. I would appreciate any help or suggestions.
WHO DO THEYTHINK THEY'REFOOLING : YOU ?
Check out the ddutils.cpp there''s a function there which does it (DDLoadPalette() i think)

//--- Created by Tom Oram ---
// tom.oram@vodafone.net

Advertisement
What do you mean by trying to swap the palette?

I'm not sure exactly where you are swapping palettes, but maybe this can help:

If you aren't getting the colors on screen that are defined in the bitmap (I think what you mean), then you can set the primary surface's palette to be the one you loaded from your bitmap by doing something like this:
        IDirectDrawPalette7 *pDDP;        PALETTEENTRY pe[256];        // TODO HERE: load the palette from your bitmap into the entries        lpDD->CreatePalette(DDPCAPS_8BIT, pe, &pDDP, NULL);        lpDDSPrimary->SetPalette(pDDP); 

Then you can do your bltfast, and the colors should match those from the loaded bitmap.

Hope that helps some.


Where's my Golden Fleece?


Edited by - Aeetes on 3/2/00 1:30:12 PM
Thank you, for your awnsers. Yes I am trying to load the bitmap palette into a pal, ill try both your suggestions !

Sorry if I have troubles expressing myself but my first language isn''t english.
WHO DO THEYTHINK THEY'REFOOLING : YOU ?

This topic is closed to new replies.

Advertisement