CPalette *CPaletteManager::Add (ubyte* buffer) { CPalette palette; memcpy (palette.Raw (), buffer, PALETTE_SIZE * 3); return Add (palette); }
/* calculate table to translate d1 bitmaps to current palette, * return -1 on error */ CPalette* CPaletteManager::LoadD1 (void) { CPalette palette; CFile cf; if (!cf.Open (D1_PALETTE, gameFolders.szDataDir, "rb", 1) || (cf.Length () != 9472)) return NULL; palette.Read (cf); cf.Close (); palette.Raw () [254] = SUPER_TRANSP_COLOR; palette.Raw () [255] = TRANSPARENCY_COLOR; SetD1 (Add (palette)); return D1 (); }