First, here is the related code:
Code:
//Palette class.
class PALETTE{
public:
unsigned char red[256];
unsigned char green[256];
unsinged char blue[256];
};
//inside Bitmap class. Stores palette in passed palette class.
void cBITMAP::ExtractPaletteAndStore(const PALETTE &palette);
//inside graphics.h
void SetPalette{const PALETTE *palette);
This is what I want to do: Okay, the functions
work fine if I declare a PALETTE variable. But,
I want the palette to be on the freestore. I
want to be able to pass the PALETTE pointer
through the ExtractPaletteAndStore function.
Code:
//works.
PALETTE L1Palette;
L1Image->ExtractPaletteAndStore(L1Palette);
SetPalette{&palette);
//doesn't work, but this is what I want to do.
PALETTE *L1Palette = new PALETTE;
L1Image->ExtractPaletteAndStore(L1Palette);
SetPalette{L1Palette);
I want to be able to store the palette in the
allocated memory. How would I go about doing this?
Can I do this without chaning the function
prototypes?
DJGPP. Windows95. 13h Game.
Thanks a lot,
-ethic