aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/faders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tinsel/faders.cpp')
-rw-r--r--engines/tinsel/faders.cpp60
1 files changed, 18 insertions, 42 deletions
diff --git a/engines/tinsel/faders.cpp b/engines/tinsel/faders.cpp
index c1574ff963..b772e37b47 100644
--- a/engines/tinsel/faders.cpp
+++ b/engines/tinsel/faders.cpp
@@ -106,7 +106,7 @@ static void FadeProcess(CORO_PARAM, const void *param) {
FadingPalette(pFade->pPalQ, true);
// get pointer to palette - reduce pointer indirection a bit
- _ctx->pPalette = (PALETTE *)LockMem(pFade->pPalQ->hPal);
+ _ctx->pPalette = (PALETTE *)LockMem(FROM_32(pFade->pPalQ->hPal));
for (_ctx->pColMult = pFade->pColorMultTable; *_ctx->pColMult >= 0; _ctx->pColMult++) {
// go through all multipliers in table - until a negative entry
@@ -117,10 +117,10 @@ static void FadeProcess(CORO_PARAM, const void *param) {
pFade->pPalQ->numColors, (uint32) *_ctx->pColMult);
else
FadePalette(_ctx->fadeRGB, _ctx->pPalette->palRGB,
- FROM_LE_32(_ctx->pPalette->numColors), (uint32) *_ctx->pColMult);
+ FROM_32(_ctx->pPalette->numColors), (uint32) *_ctx->pColMult);
// send new palette to video DAC
- UpdateDACqueue(pFade->pPalQ->posInDAC, FROM_LE_32(_ctx->pPalette->numColors), _ctx->fadeRGB);
+ UpdateDACqueue(pFade->pPalQ->posInDAC, FROM_32(_ctx->pPalette->numColors), _ctx->fadeRGB);
// allow time for video DAC to be updated
CORO_SLEEP(1);
@@ -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) {
@@ -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() {