05-03-2005, 04:11 AM
Hi,
I've been playing around with allegro in freeBASIC and have found a highcolor fading function that works in C. I've tried a few times to get this converted to basic so I can use this in my allegro-freebasic program i'm attempting.
the C code is as follows
If anyone knows if this can or cannot be done, please let me know. Any help is appreciated.
Thanks
I've been playing around with allegro in freeBASIC and have found a highcolor fading function that works in C. I've tried a few times to get this converted to basic so I can use this in my allegro-freebasic program i'm attempting.
the C code is as follows
Code:
void highcolor_fade_out(int speed)
{
BITMAP *bmp_orig, *bmp_buff;
if ((bmp_orig = create_bitmap(SCREEN_W, SCREEN_H)))
{
if ((bmp_buff = create_bitmap(SCREEN_W, SCREEN_H)))
{
int a;
blit(screen, bmp_orig, 0,0, 0,0, SCREEN_W, SCREEN_H);
if (speed <= 0) speed = 16;
for (a = 255-speed; a > 0; a-=speed)
{
clear(bmp_buff);
set_trans_blender(0,0,0,a);
draw_trans_sprite(bmp_buff, bmp_orig, 0, 0);
vsync();
blit(bmp_buff, screen, 0,0, 0,0, SCREEN_W, SCREEN_H);
}
destroy_bitmap(bmp_buff);
}
destroy_bitmap(bmp_orig);
}
rectfill(screen, 0,0, SCREEN_W,SCREEN_H, makecol(0,0,0));
}
If anyone knows if this can or cannot be done, please let me know. Any help is appreciated.
Thanks
o time for the old in-out Love, I've just come to check the meter.