[Scummvm-cvs-logs] scummvm master -> 687e47d332e24e4579c8ff4bab4858a66cbf8ab6
bluegr
bluegr at gmail.com
Fri Apr 12 06:21:37 CEST 2013
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d45534d29d TINSEL: Remove the unused noFadeTable parameter from the fader functions
a9886f1c26 TINSEL: Fix typo
53e82436e6 TINSEL: Simplify overflow calculation inside MacDrawTiles()
94b328fa7f TINSEL: Fix black/white colors in the Mac version of DW1
687e47d332 TINSEL: Remove the unused ghost palette
Commit: d45534d29d8cca396bf2f1bbd3bc63e74edeee30
https://github.com/scummvm/scummvm/commit/d45534d29d8cca396bf2f1bbd3bc63e74edeee30
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-04-11T21:19:52-07:00
Commit Message:
TINSEL: Remove the unused noFadeTable parameter from the fader functions
Changed paths:
engines/tinsel/bg.cpp
engines/tinsel/faders.cpp
engines/tinsel/faders.h
engines/tinsel/savescn.cpp
engines/tinsel/tinlib.cpp
engines/tinsel/tinsel.cpp
diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp
index ed15bfe..9f1f2c4 100644
--- a/engines/tinsel/bg.cpp
+++ b/engines/tinsel/bg.cpp
@@ -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();
diff --git a/engines/tinsel/faders.cpp b/engines/tinsel/faders.cpp
index e951710..b772e37 100644
--- a/engines/tinsel/faders.cpp
+++ b/engines/tinsel/faders.cpp
@@ -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() {
diff --git a/engines/tinsel/faders.h b/engines/tinsel/faders.h
index dc0b903..f7db902 100644
--- a/engines/tinsel/faders.h
+++ b/engines/tinsel/faders.h
@@ -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
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index 0c0cc5c..10f98df 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -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:
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 6a396b9..d15ac2f 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -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();
}
/**
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index e836fdf..9075e1a 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -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;
Commit: a9886f1c261281083dcaa8ecfbcec88be423961d
https://github.com/scummvm/scummvm/commit/a9886f1c261281083dcaa8ecfbcec88be423961d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-04-11T21:19:52-07:00
Commit Message:
TINSEL: Fix typo
Changed paths:
engines/tinsel/palette.h
diff --git a/engines/tinsel/palette.h b/engines/tinsel/palette.h
index 49a78ae..9bcbfd2 100644
--- a/engines/tinsel/palette.h
+++ b/engines/tinsel/palette.h
@@ -107,7 +107,7 @@ void PaletteStats(); // Shows the maximum number of palettes used at once
void psxPaletteMapper(PALQ *originalPal, uint8 *psxClut, byte *mapperTable); // Maps PSX CLUTs to original palette in resource file
-void PalettesToVideoDAC(); // Update the video DAC with palettes currently the the DAC queue
+void PalettesToVideoDAC(); // Update the video DAC with palettes currently in the DAC queue
void UpdateDACqueueHandle(
int posInDAC, // position in video DAC
Commit: 53e82436e6d77968e1c5e1a9c5797cae16cb76a0
https://github.com/scummvm/scummvm/commit/53e82436e6d77968e1c5e1a9c5797cae16cb76a0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-04-11T21:19:52-07:00
Commit Message:
TINSEL: Simplify overflow calculation inside MacDrawTiles()
Thanks to wjp for noticing this
Changed paths:
engines/tinsel/graphics.cpp
diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp
index b917775..ef8a102 100644
--- a/engines/tinsel/graphics.cpp
+++ b/engines/tinsel/graphics.cpp
@@ -272,7 +272,7 @@ static void MacDrawTiles(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply
tempDest += rptLength;
}
- int overflow = (copyBytes % 2) == 0 ? 0 : 2 - (copyBytes % 2);
+ int overflow = (copyBytes & 1);
x += runLength;
srcP += runLength + overflow;
}
Commit: 94b328fa7fc0b4f2cc5bb9e8b20ca8a771b3f7f4
https://github.com/scummvm/scummvm/commit/94b328fa7fc0b4f2cc5bb9e8b20ca8a771b3f7f4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-04-11T21:19:53-07:00
Commit Message:
TINSEL: Fix black/white colors in the Mac version of DW1
Changed paths:
engines/tinsel/palette.cpp
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index 0401817..c2ba40b 100644
--- a/engines/tinsel/palette.cpp
+++ b/engines/tinsel/palette.cpp
@@ -170,10 +170,14 @@ void PalettesToVideoDAC() {
pal[i * 3 + 2] = TINSEL_GetBValue(pColors[i]);
}
- // In DW1 Mac, color 254 should be black, like in the PC version.
- // We fix it here.
+ // Swap black/white colors in the Mac version.
+ // We need to swap the current black/white values so that screen fade
+ // in/out is done correctly.
if (TinselV1Mac) {
- pal[254 * 3 + 0] = pal[254 * 3 + 1] = pal[254 * 3 + 2] = 0;
+ byte macWhite = pal[ 0 * 3 + 0];
+ byte macBlack = pal[254 * 3 + 0];
+ pal[254 * 3 + 0] = pal[254 * 3 + 1] = pal[254 * 3 + 2] = macWhite;
+ pal[ 0 * 3 + 0] = pal[ 0 * 3 + 1] = pal[ 0 * 3 + 2] = macBlack;
}
// update the system palette
@@ -552,7 +556,8 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) {
// leave background color alone
g_transPalette[0] = 0;
- for (uint i = 0; i < FROM_32(pPal->numColors); i++) {
+ 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]);
@@ -564,7 +569,8 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) {
// map the Value field to one of the 4 colors reserved for the translucent palette
val /= 63;
- g_transPalette[i + 1] = (uint8)((val == 0) ? 0 : val +
+ byte blackColorIndex = (!TinselV1Mac) ? 0 : 255;
+ g_transPalette[i + 1] = (uint8)((val == 0) ? blackColorIndex : val +
(TinselV2 ? TranslucentColor() : COL_HILIGHT) - 1);
}
}
@@ -575,12 +581,12 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) {
void CreateGhostPalette(SCNHANDLE hPalette) {
// get a pointer to the palette
PALETTE *pPal = (PALETTE *)LockMem(hPalette);
- int i;
// leave background color alone
g_ghostPalette[0] = 0;
- for (i = 0; i < (int)FROM_32(pPal->numColors); i++) {
+ 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]);
Commit: 687e47d332e24e4579c8ff4bab4858a66cbf8ab6
https://github.com/scummvm/scummvm/commit/687e47d332e24e4579c8ff4bab4858a66cbf8ab6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-04-11T21:19:53-07:00
Commit Message:
TINSEL: Remove the unused ghost palette
Changed paths:
engines/tinsel/palette.cpp
engines/tinsel/palette.h
engines/tinsel/savescn.cpp
engines/tinsel/tinlib.cpp
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index c2ba40b..505cb21 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;
@@ -576,35 +574,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 9bcbfd2..c57b8df 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 10f98df..d253716 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 d15ac2f..34aa64a 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());
}
/**
More information about the Scummvm-git-logs
mailing list