int main(void) { BITMAP *tmp; allegro_init(); install_keyboard(); set_color_depth(32); set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0); /* set up a temp bitmap to so we can fade back later */ if (!(tmp = create_bitmap(SCREEN_W, SCREEN_H))) exit(1); /* create a test screen */ rectfill(screen, 0,0, SCREEN_W,SCREEN_H, makecol(255,255,255)); circlefill(screen, 75,75, 25, makecol(255,0,0)); /* save this test screen so we can fade_in to it later */ blit(screen, tmp, 0,0, 0,0, SCREEN_W, SCREEN_H); readkey(); highcolor_fade_out(16); readkey(); highcolor_fade_in(tmp, 16); readkey(); destroy_bitmap(tmp); return 0; }
void ALSoftwareGraphicsDriver::FadeIn(int speed, PALLETE p, int targetColourRed, int targetColourGreen, int targetColourBlue) { if (_colorDepth > 8) { highcolor_fade_in(virtualScreen, speed * 4, targetColourRed, targetColourGreen, targetColourBlue); } else { initialize_fade_256(targetColourRed, targetColourGreen, targetColourBlue); __fade_from_range(faded_out_palette, p, speed, 0,255); } }