From 687e47d332e24e4579c8ff4bab4858a66cbf8ab6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 12 Apr 2013 07:18:53 +0300 Subject: TINSEL: Remove the unused ghost palette --- engines/tinsel/palette.cpp | 31 ------------------------------- engines/tinsel/palette.h | 2 -- engines/tinsel/savescn.cpp | 1 - engines/tinsel/tinlib.cpp | 1 - 4 files changed, 35 deletions(-) diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index c2ba40b26d..505cb21adb 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -72,8 +72,6 @@ static VIDEO_DAC_Q *g_pDAChead; /** the translucent palette lookup table */ uint8 g_transPalette[MAX_COLORS]; // used in graphics.cpp -uint8 g_ghostPalette[MAX_COLORS]; - static int g_translucentIndex = 228; static int g_talkIndex = 233; @@ -575,35 +573,6 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) { } } -/** - * Creates the ghost palette - */ -void CreateGhostPalette(SCNHANDLE hPalette) { - // get a pointer to the palette - PALETTE *pPal = (PALETTE *)LockMem(hPalette); - - // leave background color alone - g_ghostPalette[0] = 0; - - int32 numColors = FROM_32(pPal->numColors); - for (int32 i = 0; i < numColors; i++) { - // get the RGB color model values - uint8 red = TINSEL_GetRValue(pPal->palRGB[i]); - uint8 green = TINSEL_GetGValue(pPal->palRGB[i]); - uint8 blue = TINSEL_GetBValue(pPal->palRGB[i]); - - // calculate the Value field of the HSV color model - unsigned val = (red > green) ? red : green; - val = (val > blue) ? val : blue; - - // map the Value field to one of the 4 colors reserved for the translucent palette - val /= 64; - assert(/*val >= 0 &&*/ val <= 3); - g_ghostPalette[i + 1] = (uint8)(val + SysVar(ISV_GHOST_BASE)); - } -} - - /** * Returns an adjusted color RGB * @param color Color to scale diff --git a/engines/tinsel/palette.h b/engines/tinsel/palette.h index 9bcbfd242d..c57b8df2ba 100644 --- a/engines/tinsel/palette.h +++ b/engines/tinsel/palette.h @@ -146,8 +146,6 @@ void FadingPalette(PALQ *pPalQ, bool bFading); void CreateTranslucentPalette(SCNHANDLE BackPal); -void CreateGhostPalette(SCNHANDLE hPalette); - void NoFadingPalettes(); // All fading processes have just been killed void DimPartPalette( diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp index 10f98df6d7..d2537169f7 100644 --- a/engines/tinsel/savescn.cpp +++ b/engines/tinsel/savescn.cpp @@ -360,7 +360,6 @@ static int DoRestoreSceneFrame(SAVED_DATA *sd, int n) { RestoreActorZ(sd->savedActorZ); RestoreZpositions(sd->zPositions); RestoreSysVars(sd->SavedSystemVars); - CreateGhostPalette(BgPal()); RestoreActors(sd->NumSavedActors, sd->SavedActorInfo); RestoreSoundReels(sd->SavedSoundReels); return 1; diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index d15ac2fbba..34aa64a609 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -1198,7 +1198,6 @@ static void Ghost(int actor, int tColor, int tPalOffset) { SetSysVar(ISV_GHOST_ACTOR, actor); SetSysVar(ISV_GHOST_COLOR, tColor); SetSysVar(ISV_GHOST_BASE, tPalOffset); - CreateGhostPalette(BgPal()); } /** -- cgit v1.2.3