first thing, great thank to
ThunderZ ^___^
second thing, palette function are not sync with vblank
so, small line are visible when fade ....
these functions not use gppaletteentry so, replace gppaletteentry
by 'unsigned int'
* black_pal
this function replace actual palette
by a completely black palette (color = 0x0000)
* white_pal
this function replace actual palette
by a completely white palette (color = 0xFFFF)
* random_pal
this function replace all actual palette
color by random colors
* fade_out
void fade_out(int speed)
this function fade until all palette color was != 0 (until
all screen not entirely black)
speed is number of ms between every fade pass
* fade_to_palette
void fade_to_palette(short speed, unsigned
int *pal_to_go)
this function auto fade the actual
palette to go to the specified palette
* fade_color
void fade_color(short powa, short speed,
char repeat, char color_id)
this function fade the specific color
(r g or b) in or out
short powa :
if upper than 0, fade in, else, fade out
short speed :
time between two fade pass
char repeat :
the number of pass of fade to do
char color_id :
define the color to fade, 'r' for red 'v' for
green and 'b' for blue
there is no fade in function, but it's possible to fade in
:
at the start of your prgm :
unsigned int white_pal[256] ; //
create a palette
for(cpt=0;cpt<0xFF;cpt++) white_pal[cpt] = 0xFFFF ; //
init all palette colors to be white
in your game :
fade_to_palette(40,white_pal) ; // fade in :-)