Proper implementation of o1_fadeSpecialPalette for Kyrandia 1 Amiga.

svn-id: r43233
This commit is contained in:
Johannes Schickel
2009-08-10 22:54:25 +00:00
parent 01fcad7517
commit 0d4e110d79
3 changed files with 95 additions and 89 deletions
+33 -30
View File
@@ -522,35 +522,35 @@ protected:
const uint8 *_seq_Demo4;
const uint8 *_seq_Reunion;
const char * const*_seq_WSATable;
const char * const*_seq_CPSTable;
const char * const*_seq_COLTable;
const char * const*_seq_textsTable;
const char * const *_seq_WSATable;
const char * const *_seq_CPSTable;
const char * const *_seq_COLTable;
const char * const *_seq_textsTable;
int _seq_WSATable_Size;
int _seq_CPSTable_Size;
int _seq_COLTable_Size;
int _seq_textsTable_Size;
const char * const*_itemList;
const char * const*_takenList;
const char * const*_placedList;
const char * const*_droppedList;
const char * const*_noDropList;
const char * const*_putDownFirst;
const char * const*_waitForAmulet;
const char * const*_blackJewel;
const char * const*_poisonGone;
const char * const*_healingTip;
const char * const*_thePoison;
const char * const*_fluteString;
const char * const*_wispJewelStrings;
const char * const*_magicJewelString;
const char * const*_flaskFull;
const char * const*_fullFlask;
const char * const*_veryClever;
const char * const*_homeString;
const char * const*_newGameString;
const char * const *_itemList;
const char * const *_takenList;
const char * const *_placedList;
const char * const *_droppedList;
const char * const *_noDropList;
const char * const *_putDownFirst;
const char * const *_waitForAmulet;
const char * const *_blackJewel;
const char * const *_poisonGone;
const char * const *_healingTip;
const char * const *_thePoison;
const char * const *_fluteString;
const char * const *_wispJewelStrings;
const char * const *_magicJewelString;
const char * const *_flaskFull;
const char * const *_fullFlask;
const char * const *_veryClever;
const char * const *_homeString;
const char * const *_newGameString;
int _itemList_Size;
int _takenList_Size;
@@ -572,13 +572,13 @@ protected:
int _homeString_Size;
int _newGameString_Size;
const char * const*_characterImageTable;
const char * const *_characterImageTable;
int _characterImageTableSize;
const char * const*_guiStrings;
const char * const *_guiStrings;
int _guiStringsSize;
const char * const*_configStrings;
const char * const *_configStrings;
int _configStringsSize;
Shape *_defaultShapeTable;
@@ -616,16 +616,16 @@ protected:
Room *_roomTable;
int _roomTableSize;
const char * const*_roomFilenameTable;
const char * const *_roomFilenameTable;
int _roomFilenameTableSize;
const uint8 *_amuleteAnim;
const uint8 * const*_specialPalettes;
const uint8 * const *_specialPalettes;
const char *const *_soundFiles;
const char * const *_soundFiles;
int _soundFilesSize;
const char *const *_soundFilesIntro;
const char * const *_soundFilesIntro;
int _soundFilesIntroSize;
const int32 *_cdaTrackTable;
int _cdaTrackTableSize;
@@ -648,6 +648,9 @@ protected:
static const uint16 _amuletY[];
static const uint16 _amuletX2[];
static const uint16 _amuletY2[];
// special palette handling for AMIGA
void setupZanthiaPalette(int pal);
protected:
void setupOpcodeTable();
+60
View File
@@ -1203,6 +1203,66 @@ bool KyraEngine_LoK::lineIsPassable(int x, int y) {
#pragma mark -
void KyraEngine_LoK::setupZanthiaPalette(int pal) {
uint8 r, g, b;
switch (pal - 17) {
case 0:
// 0x88F
r = 33;
g = 33;
b = 63;
break;
case 1:
// 0x00F
r = 0;
g = 0;
b = 63;
break;
case 2:
// 0xF88
r = 63;
g = 33;
b = 33;
break;
case 3:
// 0xF00
r = 63;
g = 0;
b = 0;
break;
case 4:
// 0xFF9
r = 63;
g = 63;
b = 37;
break;
case 5:
// 0xFF1
r = 63;
g = 63;
b = 4;
break;
default:
// 0xFFF
r = 63;
g = 63;
b = 63;
}
_screen->getPalette(4)[12 * 3 + 0] = r;
_screen->getPalette(4)[12 * 3 + 1] = g;
_screen->getPalette(4)[12 * 3 + 2] = b;
}
#pragma mark -
void KyraEngine_LoK::setupSceneResource(int sceneId) {
if (!_flags.isTalkie)
return;
+2 -59
View File
@@ -231,12 +231,11 @@ int KyraEngine_LoK::o1_fadeSpecialPalette(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_fadeSpecialPalette(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
if (_currentCharacter->sceneId != 45) {
if (stackPos(0) == 13) {
// TODO: Check this!
_screen->copyPalette(0, 12);
_screen->setScreenPalette(_screen->getPalette(0));
}
} else {
warning("KyraEngine_LoK::o1_fadeSpecialPalette not implemented");
setupZanthiaPalette(stackPos(0));
}
} else {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_fadeSpecialPalette(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
@@ -581,63 +580,7 @@ int KyraEngine_LoK::o1_setCustomPaletteRange(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCustomPaletteRange(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
if (_flags.platform == Common::kPlatformAmiga) {
if (_currentCharacter->sceneId == 45) {
const int palette = stackPos(0) - 17;
uint8 r, g, b;
switch (palette) {
case 0:
// 0x88F
r = 33;
g = 33;
b = 63;
break;
case 1:
// 0x00F
r = 0;
g = 0;
b = 63;
break;
case 2:
// 0xF88
r = 63;
g = 33;
b = 33;
break;
case 3:
// 0xF00
r = 63;
g = 0;
b = 0;
break;
case 4:
// 0xFF9
r = 63;
g = 63;
b = 37;
break;
case 5:
// 0xFF1
r = 63;
g = 63;
b = 4;
break;
default:
// 0xFFF
r = 63;
g = 63;
b = 63;
}
_screen->getPalette(4)[12 * 3 + 0] = r;
_screen->getPalette(4)[12 * 3 + 1] = g;
_screen->getPalette(4)[12 * 3 + 2] = b;
setupZanthiaPalette(stackPos(0));
} else if (stackPos(0) == 29) {
_screen->copyPalette(0, 11);
} else if (stackPos(0) == 13) {