that's all..
I've extracted this code from gameparkSDK, and make it work on gcc that way. This may be totally wrong. I'm a lame newbie anyway
Hope this helps..
I wrote a palette wrapper function for my game flipover:
Code:
void Palette(int index, int red, int grn, int blu, int lgt)
{
// Palette Wrapper Procedure
//
// For easier setup of palette.
// index = color (0...255)
// red = red value (0...31)
// grn = green value (0...31)
// blu = blue value (0...31)
// lgt = Intensity bit (0 or 1)
GP_PALETTEENTRY color;
color = lgt + blu*2 + grn*64 + red*2048;
GpPaletteEntryChange(index,1,&color,0);
}
It's quite easy to use:
Code:
Palette(1,31,0,0,1); // Sets colour 1 to bright red
Palette(2,31,31,31,1); // Sets colour 2 to bright white
I wrote a palette wrapper function for my game flipover:
Code:
void Palette(int index, int red, int grn, int blu, int lgt)
{
// Palette Wrapper Procedure
//
// For easier setup of palette.
// index = color (0...255)
// red = red value (0...31)
// grn = green value (0...31)
// blu = blue value (0...31)
// lgt = Intensity bit (0 or 1)
GP_PALETTEENTRY color;
color = lgt + blu*2 + grn*64 + red*2048;
GpPaletteEntryChange(index,1,&color,0);
}
It's quite easy to use:
Code:
Palette(1,31,0,0,1); // Sets colour 1 to bright red
Palette(2,31,31,31,1); // Sets colour 2 to bright white
any idea what the Mirko SDK translation of this would be??
maybe
Code:
void Palette(int index, int red, int grn, int blu, int lgt)
{
//...
gp_SetPaletteColor(255, color);
color = lgt +blu*2 +grn*64 +red&2048;
// okay, I just realised I have no idea what to do about the
// 'GpPaletteEntryChange()' thing... and yes, I do know that
// (as far as I know) I am nowhere near the right thing here...
as you can see, I'm a total noob.
of course, the function call would stay the same... unless there's something they aren't telling me... :unsure: h34r: :blink:
actually, i don't need that anymore... i've had to give up on Mirko's SDK...
so then, using the official sdk, how would you actually incorporate that into changing screen color or something?