aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorMatthew Hoops2011-04-13 16:04:29 -0400
committerMatthew Hoops2011-04-13 16:04:29 -0400
commit6d153f311c65fe414e31e99f8a9a6503c49a01a5 (patch)
tree9173f9964c0fec4215514e622f705810730d0ce9 /engines/kyra
parent47c2a9adbe8d9e6640a819386f0f34e929937672 (diff)
parent66b43f2312578f35e0718d0699de207a7bf77f1a (diff)
downloadscummvm-rg350-6d153f311c65fe414e31e99f8a9a6503c49a01a5.tar.gz
scummvm-rg350-6d153f311c65fe414e31e99f8a9a6503c49a01a5.tar.bz2
scummvm-rg350-6d153f311c65fe414e31e99f8a9a6503c49a01a5.zip
Merge remote branch 'upstream/master' into t7g-ios
Conflicts: video/qt_decoder.cpp
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/kyra_hof.cpp81
-rw-r--r--engines/kyra/kyra_hof.h6
-rw-r--r--engines/kyra/kyra_mr.cpp2
-rw-r--r--engines/kyra/kyra_mr.h2
-rw-r--r--engines/kyra/kyra_v2.cpp5
-rw-r--r--engines/kyra/kyra_v2.h3
-rw-r--r--engines/kyra/lol.cpp4
-rw-r--r--engines/kyra/resource.h2
-rw-r--r--engines/kyra/resource_intern.cpp2
-rw-r--r--engines/kyra/saveload.cpp14
-rw-r--r--engines/kyra/scene_v2.cpp11
-rw-r--r--engines/kyra/script.cpp6
-rw-r--r--engines/kyra/script.h4
-rw-r--r--engines/kyra/script_tim.cpp4
-rw-r--r--engines/kyra/vqa.cpp42
15 files changed, 101 insertions, 87 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index 990e55bcf2..c73792ef8e 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -87,7 +87,9 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn
_pathfinderFlag = 0;
_mouseX = _mouseY = 0;
+ _nextIdleAnim = 0;
_lastIdleScript = -1;
+ _useSceneIdleAnim = false;
_currentTalkSections.STATim = 0;
_currentTalkSections.TLKTim = 0;
@@ -145,6 +147,11 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn
_menu = 0;
_chatIsNote = false;
memset(&_npcScriptData, 0, sizeof(_npcScriptData));
+
+ _setCharPalFinal = false;
+ _useCharPal = false;
+
+ memset(_characterFacingCountTable, 0, sizeof(_characterFacingCountTable));
}
KyraEngine_HoF::~KyraEngine_HoF() {
@@ -1135,8 +1142,6 @@ void KyraEngine_HoF::restorePage0() {
}
void KyraEngine_HoF::updateCharPal(int unk1) {
- static bool unkVar1 = false;
-
if (!_useCharPal)
return;
@@ -1152,12 +1157,12 @@ void KyraEngine_HoF::updateCharPal(int unk1) {
++src;
}
_screen->setScreenPalette(_screen->getPalette(0));
- unkVar1 = true;
+ _setCharPalFinal = true;
_charPalEntry = palEntry;
- } else if (unkVar1 || !unk1) {
+ } else if (_setCharPalFinal || !unk1) {
_screen->getPalette(0).copy(_scenePal, palEntry << 4, 16, 112);
_screen->setScreenPalette(_screen->getPalette(0));
- unkVar1 = false;
+ _setCharPalFinal = false;
}
}
@@ -1274,15 +1279,14 @@ int KyraEngine_HoF::getCharacterWalkspeed() const {
return _timer->getDelay(0);
}
-void KyraEngine_HoF::updateCharAnimFrame(int charId, int *table) {
- static int unkTable1[] = { 0, 0 };
- static const int unkTable2[] = { 17, 0 };
- static const int unkTable3[] = { 10, 0 };
- static const int unkTable4[] = { 24, 0 };
- static const int unkTable5[] = { 19, 0 };
- static const int unkTable6[] = { 21, 0 };
- static const int unkTable7[] = { 31, 0 };
- static const int unkTable8[] = { 26, 0 };
+void KyraEngine_HoF::updateCharAnimFrame(int *table) {
+ static const int unkFrame1 = 17;
+ static const int unkFrame2 = 10;
+ static const int unkFrame3 = 24;
+ static const int unkFrame4 = 19;
+ static const int unkFrame5 = 21;
+ static const int unkFrame6 = 31;
+ static const int unkFrame7 = 26;
Character *character = &_mainCharacter;
++character->animFrame;
@@ -1297,46 +1301,46 @@ void KyraEngine_HoF::updateCharAnimFrame(int charId, int *table) {
}
if (!facing) {
- ++unkTable1[charId];
+ ++_characterFacingCountTable[0];
} else if (facing == 4) {
- ++unkTable1[charId+1];
+ ++_characterFacingCountTable[1];
} else if (facing == 7 || facing == 1 || facing == 5 || facing == 3) {
if (facing == 7 || facing == 1) {
- if (unkTable1[charId] > 2)
+ if (_characterFacingCountTable[0] > 2)
facing = 0;
} else {
- if (unkTable1[charId+1] > 2)
+ if (_characterFacingCountTable[1] > 2)
facing = 4;
}
- unkTable1[charId] = 0;
- unkTable1[charId+1] = 0;
+ _characterFacingCountTable[0] = 0;
+ _characterFacingCountTable[1] = 0;
}
if (facing == 0) {
- if (character->animFrame < unkTable8[charId])
- character->animFrame = unkTable8[charId];
+ if (character->animFrame < unkFrame7)
+ character->animFrame = unkFrame7;
- if (character->animFrame > unkTable7[charId])
- character->animFrame = unkTable8[charId];
+ if (character->animFrame > unkFrame6)
+ character->animFrame = unkFrame7;
} else if (facing == 4) {
- if (character->animFrame < unkTable5[charId])
- character->animFrame = unkTable5[charId];
+ if (character->animFrame < unkFrame4)
+ character->animFrame = unkFrame4;
- if (character->animFrame > unkTable4[charId])
- character->animFrame = unkTable5[charId];
+ if (character->animFrame > unkFrame3)
+ character->animFrame = unkFrame4;
} else {
- if (character->animFrame > unkTable5[charId])
- character->animFrame = unkTable6[charId];
+ if (character->animFrame > unkFrame4)
+ character->animFrame = unkFrame5;
- if (character->animFrame == unkTable2[charId])
- character->animFrame = unkTable3[charId];
+ if (character->animFrame == unkFrame1)
+ character->animFrame = unkFrame2;
- if (character->animFrame > unkTable2[charId])
- character->animFrame = unkTable3[charId] + 2;
+ if (character->animFrame > unkFrame1)
+ character->animFrame = unkFrame2 + 2;
}
- updateCharacterAnim(charId);
+ updateCharacterAnim(0);
}
bool KyraEngine_HoF::checkCharCollision(int x, int y) {
@@ -1393,12 +1397,11 @@ void KyraEngine_HoF::showIdleAnim() {
if (queryGameFlag(0x159) && _flags.isTalkie)
return;
- static bool scriptAnimation = false;
- if (!scriptAnimation && _flags.isTalkie) {
- scriptAnimation = true;
+ if (!_useSceneIdleAnim && _flags.isTalkie) {
+ _useSceneIdleAnim = true;
randomSceneChat();
} else {
- scriptAnimation = false;
+ _useSceneIdleAnim = false;
if (_characterShapeFile > 8)
return;
diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h
index b862a89dd0..308698484d 100644
--- a/engines/kyra/kyra_hof.h
+++ b/engines/kyra/kyra_hof.h
@@ -574,13 +574,16 @@ protected:
// character
bool _useCharPal;
+ bool _setCharPalFinal;
int _charPalEntry;
uint8 _charPalTable[16];
void updateCharPal(int unk1);
void setCharPalEntry(int entry, int value);
+ int _characterFacingCountTable[2];
+
int getCharacterWalkspeed() const;
- void updateCharAnimFrame(int num, int *table);
+ void updateCharAnimFrame(int *table);
bool checkCharCollision(int x, int y);
@@ -681,6 +684,7 @@ protected:
uint32 _nextIdleAnim;
int _lastIdleScript;
+ bool _useSceneIdleAnim;
void setNextIdleAnimTimer();
void showIdleAnim();
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index fee7835881..65e78448a5 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -788,7 +788,7 @@ int KyraEngine_MR::getCharacterWalkspeed() const {
return _mainCharacter.walkspeed;
}
-void KyraEngine_MR::updateCharAnimFrame(int character, int *table) {
+void KyraEngine_MR::updateCharAnimFrame(int *table) {
++_mainCharacter.animFrame;
int facing = _mainCharacter.facing;
diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h
index f5ff3772ba..912c615757 100644
--- a/engines/kyra/kyra_mr.h
+++ b/engines/kyra/kyra_mr.h
@@ -386,7 +386,7 @@ private:
// character
int getCharacterWalkspeed() const;
- void updateCharAnimFrame(int character, int *table);
+ void updateCharAnimFrame(int *table);
int8 _characterAnimTable[2];
static const uint8 _characterFrameTable[];
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 53c57c21cd..804097c81d 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -74,6 +74,9 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const Engi
_pauseStart = 0;
+ _pathfinderFlag = 0;
+ _smoothingPath = false;
+
_lang = 0;
Common::Language lang = Common::parseLanguage(ConfMan.get("language"));
if (lang == _flags.fanLang && _flags.replacedLang != Common::UNK_LANG)
@@ -236,7 +239,7 @@ int KyraEngine_v2::updateCharPos(int *table, int force) {
return 0;
_mainCharacter.x1 += _charAddXPosTable[_mainCharacter.facing];
_mainCharacter.y1 += _charAddYPosTable[_mainCharacter.facing];
- updateCharAnimFrame(0, table);
+ updateCharAnimFrame(table);
_updateCharPosNextUpdate = _system->getMillis() + getCharacterWalkspeed() * _tickLength;
return 1;
}
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index 084b159ee2..9f0aecd78c 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -269,6 +269,7 @@ protected:
// pathfinder
int _movFacingTable[600];
int _pathfinderFlag;
+ bool _smoothingPath;
int findWay(int curX, int curY, int dstX, int dstY, int *moveTable, int moveTableSize);
@@ -340,7 +341,7 @@ protected:
uint32 _updateCharPosNextUpdate;
virtual int getCharacterWalkspeed() const = 0;
- virtual void updateCharAnimFrame(int num, int *table) = 0;
+ virtual void updateCharAnimFrame(int *table) = 0;
// chat
int _vocHigh;
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 7003d8c38f..5928c40f92 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -898,7 +898,9 @@ void LoLEngine::startupNew() {
memset(_globalScriptVars2, 0x100, 8);
- static int selectIds[] = { -9, -1, -8, -5 };
+ static const int selectIds[] = { -9, -1, -8, -5 };
+ assert(_charSelection >= 0);
+ assert(_charSelection < ARRAYSIZE(selectIds));
addCharacter(selectIds[_charSelection]);
gui_enableDefaultPlayfieldButtons();
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index 8372bf9ad1..9948c52001 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -102,7 +102,7 @@ protected:
enum KyraResources {
kLoadAll = -1,
- // This list has to match orderwise (and thus value wise) the static data list of "tools/create_kyradat/create_kyradat.h"!
+ // This list has to match orderwise (and thus value wise) the static data list of "devtools/create_kyradat/create_kyradat.h"!
k1ForestSeq = 1,
k1KallakWritingSeq,
k1KyrandiaLogoSeq,
diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp
index f26cb8fb26..1dc084f14d 100644
--- a/engines/kyra/resource_intern.cpp
+++ b/engines/kyra/resource_intern.cpp
@@ -356,7 +356,7 @@ Common::Archive *ResLoaderPak::load(Common::ArchiveMemberPtr memberFile, Common:
const uint32 magic = stream.readUint32BE();
- if (magic != MKID_BE('SCVM'))
+ if (magic != MKTAG('S','C','V','M'))
error("LINKLIST file does not contain 'SCVM' header");
const uint32 links = stream.readUint32BE();
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index cd5ef52b92..44579c3377 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -47,13 +47,13 @@ KyraEngine_v1::kReadSaveHeaderError KyraEngine_v1::readSaveHeader(Common::Seekab
header.flags = 0;
header.thumbnail = 0;
- if (type == MKID_BE('KYRA') || type == MKID_BE('ARYK')) { // old Kyra1 header ID
+ if (type == MKTAG('K','Y','R','A') || type == MKTAG('A','R','Y','K')) { // old Kyra1 header ID
header.gameID = GI_KYRA1;
header.oldHeader = true;
- } else if (type == MKID_BE('HOFS')) { // old Kyra2 header ID
+ } else if (type == MKTAG('H','O','F','S')) { // old Kyra2 header ID
header.gameID = GI_KYRA2;
header.oldHeader = true;
- } else if (type == MKID_BE('WWSV')) {
+ } else if (type == MKTAG('W','W','S','V')) {
header.gameID = in->readByte();
} else {
// try checking for original save header
@@ -71,12 +71,12 @@ KyraEngine_v1::kReadSaveHeaderError KyraEngine_v1::readSaveHeader(Common::Seekab
type = in->readUint32BE();
header.version = in->readUint16LE();
- if (type == MKID_BE('MBL3') && header.version == 100) {
+ if (type == MKTAG('M','B','L','3') && header.version == 100) {
saveOk = true;
header.description = descriptionBuffer;
header.gameID = GI_KYRA2;
break;
- } else if (type == MKID_BE('MBL4') && header.version == 102) {
+ } else if (type == MKTAG('M','B','L','4') && header.version == 102) {
saveOk = true;
header.description = descriptionBuffer;
header.gameID = GI_KYRA3;
@@ -94,7 +94,7 @@ KyraEngine_v1::kReadSaveHeaderError KyraEngine_v1::readSaveHeader(Common::Seekab
}
header.version = in->readUint32BE();
- if (header.version > CURRENT_SAVE_VERSION || (header.oldHeader && header.version > 8) || (type == MKID_BE('ARYK') && header.version > 3))
+ if (header.version > CURRENT_SAVE_VERSION || (header.oldHeader && header.version > 8) || (type == MKTAG('A','R','Y','K') && header.version > 3))
return kRSHEInvalidVersion;
// Versions prior to 9 are using a fixed length description field
@@ -190,7 +190,7 @@ Common::WriteStream *KyraEngine_v1::openSaveForWriting(const char *filename, con
}
// Savegame version
- out->writeUint32BE(MKID_BE('WWSV'));
+ out->writeUint32BE(MKTAG('W','W','S','V'));
out->writeByte(_flags.gameID);
out->writeUint32BE(CURRENT_SAVE_VERSION);
out->write(saveName, strlen(saveName)+1);
diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp
index f0c26acd54..fdfbceb521 100644
--- a/engines/kyra/scene_v2.cpp
+++ b/engines/kyra/scene_v2.cpp
@@ -86,15 +86,16 @@ int KyraEngine_v2::findWay(int x, int y, int toX, int toY, int *moveTable, int m
x &= ~3; toX &= ~3;
y &= ~1; toY &= ~1;
int size = KyraEngine_v1::findWay(x, y, toX, toY, moveTable, moveTableSize);
- static bool usePostProcess = false;
- if (size && !usePostProcess) {
- usePostProcess = true;
+
+ if (size && !_smoothingPath) {
+ _smoothingPath = true;
int temp = pathfinderInitPositionTable(moveTable);
temp = pathfinderInitPositionIndexTable(temp, x, y);
pathfinderFinializePath(moveTable, temp, x, y, moveTableSize);
- usePostProcess = false;
+ _smoothingPath = false;
}
- return usePostProcess ? size : getMoveTableSize(moveTable);
+
+ return _smoothingPath ? size : getMoveTableSize(moveTable);
}
bool KyraEngine_v2::directLinePassable(int x, int y, int toX, int toY) {
diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp
index 0343cbfeae..956bf39b5a 100644
--- a/engines/kyra/script.cpp
+++ b/engines/kyra/script.cpp
@@ -68,14 +68,14 @@ EMCInterpreter::EMCInterpreter(KyraEngine_v1 *vm) : _vm(vm), _scriptData(0), _fi
bool EMCInterpreter::callback(Common::IFFChunk &chunk) {
switch (chunk._type) {
- case MKID_BE('TEXT'):
+ case MKTAG('T','E','X','T'):
_scriptData->text = new byte[chunk._size];
assert(_scriptData->text);
if (chunk._stream->read(_scriptData->text, chunk._size) != chunk._size)
error("Couldn't read TEXT chunk from file '%s'", _filename);
break;
- case MKID_BE('ORDR'):
+ case MKTAG('O','R','D','R'):
_scriptData->ordr = new uint16[chunk._size >> 1];
assert(_scriptData->ordr);
if (chunk._stream->read(_scriptData->ordr, chunk._size) != chunk._size)
@@ -85,7 +85,7 @@ bool EMCInterpreter::callback(Common::IFFChunk &chunk) {
_scriptData->ordr[i] = READ_BE_UINT16(&_scriptData->ordr[i]);
break;
- case MKID_BE('DATA'):
+ case MKTAG('D','A','T','A'):
_scriptData->data = new uint16[chunk._size >> 1];
assert(_scriptData->data);
if (chunk._stream->read(_scriptData->data, chunk._size) != chunk._size)
diff --git a/engines/kyra/script.h b/engines/kyra/script.h
index 68620829bb..faa80a3f21 100644
--- a/engines/kyra/script.h
+++ b/engines/kyra/script.h
@@ -84,9 +84,9 @@ public:
// Both lead to some problems in our IFF parser, either reading after the end
// of file or producing a "Chunk overread" error message. To work around this
// we need to adjust the size field properly.
- if (_formType == MKID_BE('EMC2'))
+ if (_formType == MKTAG('E','M','C','2'))
_formChunk.size -= 8;
- else if (_formType == MKID_BE('AVFS'))
+ else if (_formType == MKTAG('A','V','F','S'))
_formChunk.size += 4;
}
};
diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp
index 28f18a1f79..1e978caf15 100644
--- a/engines/kyra/script_tim.cpp
+++ b/engines/kyra/script_tim.cpp
@@ -115,14 +115,14 @@ TIMInterpreter::~TIMInterpreter() {
bool TIMInterpreter::callback(Common::IFFChunk &chunk) {
switch (chunk._type) {
- case MKID_BE('TEXT'):
+ case MKTAG('T','E','X','T'):
_tim->text = new byte[chunk._size];
assert(_tim->text);
if (chunk._stream->read(_tim->text, chunk._size) != chunk._size)
error("Couldn't read TEXT chunk from file '%s'", _filename);
break;
- case MKID_BE('AVTL'):
+ case MKTAG('A','V','T','L'):
_avtlChunkSize = chunk._size >> 1;
_tim->avtl = new uint16[_avtlChunkSize];
assert(_tim->avtl);
diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp
index 382ec2429d..b3371793de 100644
--- a/engines/kyra/vqa.cpp
+++ b/engines/kyra/vqa.cpp
@@ -204,7 +204,7 @@ bool VQAMovie::open(const char *filename) {
if (!_file)
return false;
- if (_file->readUint32BE() != MKID_BE('FORM')) {
+ if (_file->readUint32BE() != MKTAG('F','O','R','M')) {
warning("VQAMovie::open: Cannot find `FORM' tag");
return false;
}
@@ -212,7 +212,7 @@ bool VQAMovie::open(const char *filename) {
// For now, we ignore the size of the FORM chunk.
_file->readUint32BE();
- if (_file->readUint32BE() != MKID_BE('WVQA')) {
+ if (_file->readUint32BE() != MKTAG('W','V','Q','A')) {
warning("WQAMovie::open: Cannot find `WVQA' tag");
return false;
}
@@ -228,7 +228,7 @@ bool VQAMovie::open(const char *filename) {
uint32 size = _file->readUint32BE();
switch (tag) {
- case MKID_BE('VQHD'): // VQA header
+ case MKTAG('V','Q','H','D'): // VQA header
_header.version = _file->readUint16LE();
_header.flags = _file->readUint16LE();
_header.numFrames = _file->readUint16LE();
@@ -304,7 +304,7 @@ bool VQAMovie::open(const char *filename) {
foundHeader = true;
break;
- case MKID_BE('FINF'): // Frame info
+ case MKTAG('F','I','N','F'): // Frame info
if (!foundHeader) {
warning("VQAMovie::open: Found `FINF' before `VQHD'");
return false;
@@ -343,7 +343,7 @@ bool VQAMovie::open(const char *filename) {
if (_file->eos())
break;
- if (scanTag == MKID_BE('VQFR')) {
+ if (scanTag == MKTAG('V','Q','F','R')) {
_frameInfo[0] = (_file->pos() - 8) | 0x80000000;
break;
}
@@ -421,7 +421,7 @@ void VQAMovie::displayFrame(uint frameNum) {
int32 end;
switch (tag) {
- case MKID_BE('SND0'): // Uncompressed sound
+ case MKTAG('S','N','D','0'): // Uncompressed sound
foundSound = true;
inbuf = (byte *)malloc(size);
_file->read(inbuf, size);
@@ -429,7 +429,7 @@ void VQAMovie::displayFrame(uint frameNum) {
_stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
break;
- case MKID_BE('SND1'): // Compressed sound, almost like AUD
+ case MKTAG('S','N','D','1'): // Compressed sound, almost like AUD
foundSound = true;
outsize = _file->readUint16LE();
insize = _file->readUint16LE();
@@ -449,13 +449,13 @@ void VQAMovie::displayFrame(uint frameNum) {
}
break;
- case MKID_BE('SND2'): // Compressed sound
+ case MKTAG('S','N','D','2'): // Compressed sound
foundSound = true;
warning("VQAMovie::displayFrame: `SND2' is not implemented");
_file->seek(size, SEEK_CUR);
break;
- case MKID_BE('VQFR'):
+ case MKTAG('V','Q','F','R'):
foundFrame = true;
end = _file->pos() + size - 8;
@@ -464,49 +464,49 @@ void VQAMovie::displayFrame(uint frameNum) {
size = _file->readUint32BE();
switch (tag) {
- case MKID_BE('CBF0'): // Full codebook
+ case MKTAG('C','B','F','0'): // Full codebook
_file->read(_codeBook, size);
break;
- case MKID_BE('CBFZ'): // Full codebook
+ case MKTAG('C','B','F','Z'): // Full codebook
inbuf = (byte *)allocBuffer(0, size);
_file->read(inbuf, size);
Screen::decodeFrame4(inbuf, _codeBook, _codeBookSize);
break;
- case MKID_BE('CBP0'): // Partial codebook
+ case MKTAG('C','B','P','0'): // Partial codebook
_compressedCodeBook = false;
_file->read(_partialCodeBook + _partialCodeBookSize, size);
_partialCodeBookSize += size;
_numPartialCodeBooks++;
break;
- case MKID_BE('CBPZ'): // Partial codebook
+ case MKTAG('C','B','P','Z'): // Partial codebook
_compressedCodeBook = true;
_file->read(_partialCodeBook + _partialCodeBookSize, size);
_partialCodeBookSize += size;
_numPartialCodeBooks++;
break;
- case MKID_BE('CPL0'): // Palette
+ case MKTAG('C','P','L','0'): // Palette
assert(size <= 3 * 256);
_file->read(_screen->getPalette(0).getData(), size);
break;
- case MKID_BE('CPLZ'): // Palette
+ case MKTAG('C','P','L','Z'): // Palette
inbuf = (byte *)allocBuffer(0, size);
_file->read(inbuf, size);
Screen::decodeFrame4(inbuf, _screen->getPalette(0).getData(), 768);
break;
- case MKID_BE('VPT0'): // Frame data
+ case MKTAG('V','P','T','0'): // Frame data
assert(size / 2 <= _numVectorPointers);
for (i = 0; i < size / 2; i++)
_vectorPointers[i] = _file->readUint16LE();
break;
- case MKID_BE('VPTZ'): // Frame data
+ case MKTAG('V','P','T','Z'): // Frame data
inbuf = (byte *)allocBuffer(0, size);
outbuf = (byte *)allocBuffer(1, 2 * _numVectorPointers);
@@ -613,13 +613,13 @@ void VQAMovie::play() {
}
switch (tag) {
- case MKID_BE('SND0'): // Uncompressed sound
+ case MKTAG('S','N','D','0'): // Uncompressed sound
inbuf = (byte *)malloc(size);
_file->read(inbuf, size);
_stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
break;
- case MKID_BE('SND1'): // Compressed sound
+ case MKTAG('S','N','D','1'): // Compressed sound
outsize = _file->readUint16LE();
insize = _file->readUint16LE();
@@ -636,12 +636,12 @@ void VQAMovie::play() {
}
break;
- case MKID_BE('SND2'): // Compressed sound
+ case MKTAG('S','N','D','2'): // Compressed sound
warning("VQAMovie::play: `SND2' is not implemented");
_file->seek(size, SEEK_CUR);
break;
- case MKID_BE('CMDS'): // Unused tag, always empty in kyra3
+ case MKTAG('C','M','D','S'): // Unused tag, always empty in kyra3
_file->seek(size, SEEK_CUR);
break;