void IAGSEngine::SetPalette (int32 start, int32 finish, AGSColor *cpl) { wsetpalette (start, finish, (color*)cpl); }
/* *** SCRIPT SYMBOL: [Multimedia] PlayFlic *** */ void play_flc_file(int numb,int playflags) { color oldpal[256]; if (play.fast_forward) return; wreadpalette(0,255,oldpal); int clearScreenAtStart = 1; canabort = playflags % 10; playflags -= canabort; if (canabort == 2) // convert to PlayVideo-compatible setting canabort = 3; if (playflags % 100 == 0) stretch_flc = 1; else stretch_flc = 0; if (playflags / 100) clearScreenAtStart = 0; char flicnam[20]; sprintf(flicnam,"flic%d.flc",numb); FILE*iii=clibfopen(flicnam,"rb"); if (iii==NULL) { sprintf(flicnam,"flic%d.fli",numb); iii=clibfopen(flicnam,"rb"); } if (iii==NULL) { debug_log("FLIC animation FLIC%d.FLC not found",numb); return; } fseek(iii,8,SEEK_CUR); fread(&fliwidth,2,1,iii); fread(&fliheight,2,1,iii); fclose(iii); if (game.color_depth > 1) { hicol_buf=create_bitmap_ex(final_col_dep,fliwidth,fliheight); clear(hicol_buf); } // override the stretch option if necessary if ((fliwidth==scrnwid) && (fliheight==scrnhit)) stretch_flc = 0; else if ((fliwidth > scrnwid) || (fliheight > scrnhit)) stretch_flc = 1; fli_buffer=create_bitmap_ex(8,fliwidth,fliheight); //640,400); //scrnwid,scrnhit); if (fli_buffer==NULL) quit("Not enough memory to play animation"); clear(fli_buffer); if (clearScreenAtStart) { clear(screen); render_to_screen(screen, 0, 0); } fli_target = create_bitmap_ex(final_col_dep, BMP_W(screen), BMP_H(screen)); fli_ddb = gfxDriver->CreateDDBFromBitmap(fli_target, false, true); if (play_fli(flicnam,fli_buffer,0,fli_callback)==FLI_ERROR) quit("FLI/FLC animation play error"); wfreeblock(fli_buffer); clear(screen); wsetpalette(0,255,oldpal); render_to_screen(screen, 0, 0); destroy_bitmap(fli_target); gfxDriver->DestroyDDB(fli_ddb); fli_ddb = NULL; if (hicol_buf!=NULL) { wfreeblock(hicol_buf); hicol_buf=NULL; } // wsetscreen(screen); wputblock(0,0,backbuffer,0); while (ac_mgetbutton()!=NONE) ; invalidate_screen(); }