Skip to content

Commit

Permalink
TINSEL: Remove the unused noFadeTable parameter from the fader functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Apr 12, 2013
1 parent 8b315ae commit d45534d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 52 deletions.
2 changes: 1 addition & 1 deletion engines/tinsel/bg.cpp
Expand Up @@ -153,7 +153,7 @@ static void BGmainProcess(CORO_PARAM, const void *param) {
}

if (g_bDoFadeIn) {
FadeInFast(NULL);
FadeInFast();
g_bDoFadeIn = false;
} else if (TinselV2)
PokeInTagColor();
Expand Down
54 changes: 15 additions & 39 deletions engines/tinsel/faders.cpp
Expand Up @@ -137,9 +137,8 @@ static void FadeProcess(CORO_PARAM, const void *param) {
* Generic palette fader/unfader. Creates a 'FadeProcess' process
* for each palette that is to fade.
* @param multTable Fixed point color multiplier table
* @param noFadeTable List of palettes not to fade
*/
static void Fader(const long multTable[], SCNHANDLE noFadeTable[]) {
static void Fader(const long multTable[]) {
PALQ *pPal; // palette manager iterator

if (TinselV2) {
Expand All @@ -151,84 +150,61 @@ static void Fader(const long multTable[], SCNHANDLE noFadeTable[]) {

// create a process for each palette in the palette queue
for (pPal = GetNextPalette(NULL); pPal != NULL; pPal = GetNextPalette(pPal)) {
bool bFade = true;
// assume we want to fade this palette

// is palette in the list of palettes not to fade
if (noFadeTable != NULL) {
// there is a list of palettes not to fade
for (int i = 0; noFadeTable[i] != 0; i++) {
if (pPal->hPal == noFadeTable[i]) {
// palette is in the list - dont fade it
bFade = false;

// leave loop prematurely
break;
}
}
}

if (bFade) {
FADE fade;
FADE fade;

// fill in FADE struct
fade.pColorMultTable = multTable;
fade.pPalQ = pPal;
// fill in FADE struct
fade.pColorMultTable = multTable;
fade.pPalQ = pPal;

// create a fader process for this palette
CoroScheduler.createProcess(PID_FADER, FadeProcess, (void *)&fade, sizeof(FADE));
}
// create a fader process for this palette
CoroScheduler.createProcess(PID_FADER, FadeProcess, (void *)&fade, sizeof(FADE));
}
}

/**
* Fades a list of palettes down to black.
* 'noFadeTable' is a NULL terminated list of palettes not to fade.
*/
void FadeOutMedium(SCNHANDLE noFadeTable[]) {
void FadeOutMedium() {
// Fixed point fade multiplier table
static const long fadeout[] = {0xea00, 0xd000, 0xb600, 0x9c00,
0x8200, 0x6800, 0x4e00, 0x3400, 0x1a00, 0, -1};

// call generic fader
Fader(fadeout, noFadeTable);
Fader(fadeout);
}

/**
* Fades a list of palettes down to black.
* @param noFadeTable A NULL terminated list of palettes not to fade.
*/
void FadeOutFast(SCNHANDLE noFadeTable[]) {
void FadeOutFast() {
// Fixed point fade multiplier table
static const long fadeout[] = {0xd000, 0xa000, 0x7000, 0x4000, 0x1000, 0, -1};

// call generic fader
Fader(fadeout, noFadeTable);
Fader(fadeout);
}

/**
* Fades a list of palettes from black to their current colors.
* 'noFadeTable' is a NULL terminated list of palettes not to fade.
*/
void FadeInMedium(SCNHANDLE noFadeTable[]) {
void FadeInMedium() {
// Fade multiplier table
static const long fadein[] = {0, 0x1a00, 0x3400, 0x4e00, 0x6800,
0x8200, 0x9c00, 0xb600, 0xd000, 0xea00, 0x10000L, -1};

// call generic fader
Fader(fadein, noFadeTable);
Fader(fadein);
}

/**
* Fades a list of palettes from black to their current colors.
* @param noFadeTable A NULL terminated list of palettes not to fade.
*/
void FadeInFast(SCNHANDLE noFadeTable[]) {
void FadeInFast() {
// Fade multiplier table
static const long fadein[] = {0, 0x1000, 0x4000, 0x7000, 0xa000, 0xd000, 0x10000L, -1};

// call generic fader
Fader(fadein, noFadeTable);
Fader(fadein);
}

void PokeInTagColor() {
Expand Down
12 changes: 4 additions & 8 deletions engines/tinsel/faders.h
Expand Up @@ -39,14 +39,10 @@ namespace Tinsel {
|* Fader Function Prototypes *|
\*----------------------------------------------------------------------*/

// usefull palette faders - they all need a list of palettes that
// should not be faded. This parameter can be
// NULL - fade all palettes.

void FadeOutMedium(SCNHANDLE noFadeTable[]);
void FadeOutFast(SCNHANDLE noFadeTable[]);
void FadeInMedium(SCNHANDLE noFadeTable[]);
void FadeInFast(SCNHANDLE noFadeTable[]);
void FadeOutMedium();
void FadeOutFast();
void FadeInMedium();
void FadeInFast();
void PokeInTagColor();

} // End of namespace Tinsel
Expand Down
2 changes: 1 addition & 1 deletion engines/tinsel/savescn.cpp
Expand Up @@ -303,7 +303,7 @@ static int DoRestoreSceneFrame(SAVED_DATA *sd, int n) {
switch (n) {
case RS_COUNT + COUNTOUT_COUNT:
// Trigger pre-load and fade and start countdown
FadeOutFast(NULL);
FadeOutFast();
break;

case RS_COUNT:
Expand Down
4 changes: 2 additions & 2 deletions engines/tinsel/tinlib.cpp
Expand Up @@ -1151,14 +1151,14 @@ static void FaceTag(int actor, HPOLYGON hp) {
* FadeIn
*/
static void FadeIn() {
FadeInMedium(NULL);
FadeInMedium();
}

/**
* FadeOut
*/
static void FadeOut() {
FadeOutMedium(NULL);
FadeOutMedium();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion engines/tinsel/tinsel.cpp
Expand Up @@ -666,7 +666,7 @@ bool ChangeScene(bool bReset) {
default:
// Trigger pre-load and fade and start countdown
CountOut = COUNTOUT_COUNT;
FadeOutFast(NULL);
FadeOutFast();
if (TinselV2)
_vm->_pcmMusic->startFadeOut(COUNTOUT_COUNT);
break;
Expand Down

0 comments on commit d45534d

Please sign in to comment.