Public Member Functions | |
| void | setPalette (const byte *colors, uint start, uint num) override |
| void | grabPalette (byte *colors, uint start, uint num) const override |
Public Member Functions inherited from PaletteManager | |
| void | setPalette (const Graphics::Palette &pal, uint start=0) |
| Graphics::Palette | grabPalette (uint start, uint num) |
|
overridevirtual |
Replace the specified range of the palette with new colors. The palette entries from 'start' till (start+num-1) will be replaced - so a full palette update is accomplished via start=0, num=256.
The palette data is specified in interleaved RGB format. That is, the first byte of the memory block 'colors' points at is the red component of the first new color; the second byte the green component of the first new color; the third byte the blue component, the last byte to the alpha (transparency) value. Then the second color starts, and so on. So memory looks like this: R1-G1-B1-R2-G2-B2-R3-...
| colors | the new palette data, in interleaved RGB format |
| start | the first palette entry to be updated |
| num | the number of palette entries to be updated |
Implements PaletteManager.
|
overridevirtual |
Grabs a specified part of the currently active palette. The format is the same as for setPalette.
This should return exactly the same RGB data as was setup via previous setPalette calls.
For example, for every valid value of start and num of the following code:
byte origPal[num*3]; // Setup origPal's data however you like g_system->setPalette(origPal, start, num); byte obtainedPal[num*3]; g_system->grabPalette(obtainedPal, start, num);
the following should be true:
memcmp(origPal, obtainedPal, num*3) == 0
| colors | the palette data, in interleaved RGB format |
| start | the first platte entry to be read |
| num | the number of palette entries to be read |
Implements PaletteManager.