aboutsummaryrefslogtreecommitdiff
path: root/engines/toon
diff options
context:
space:
mode:
authorMax Horn2011-04-12 16:53:15 +0200
committerMax Horn2011-04-12 16:53:15 +0200
commit0ce2ca4e006a70d787481040fa844c85aac43222 (patch)
tree25fb61d7e7165ec2570ecf14a4af52e9bdb6b176 /engines/toon
parenta8b3501252c46c3fc4fd129fa0a945eb87f47d0a (diff)
downloadscummvm-rg350-0ce2ca4e006a70d787481040fa844c85aac43222.tar.gz
scummvm-rg350-0ce2ca4e006a70d787481040fa844c85aac43222.tar.bz2
scummvm-rg350-0ce2ca4e006a70d787481040fa844c85aac43222.zip
COMMON: Replace MKID_BE by MKTAG
MKID_BE relied on unspecified behavior of the C++ compiler, and as such was always a bit unsafe. The new MKTAG macro is slightly less elegant, but does no longer depend on the behavior of the compiler. Inspired by FFmpeg, which has an almost identical macro.
Diffstat (limited to 'engines/toon')
-rw-r--r--engines/toon/script.cpp6
-rw-r--r--engines/toon/script.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/engines/toon/script.cpp b/engines/toon/script.cpp
index 376b1db621..0242ace7e3 100644
--- a/engines/toon/script.cpp
+++ b/engines/toon/script.cpp
@@ -70,7 +70,7 @@ EMCInterpreter::~EMCInterpreter() {
bool EMCInterpreter::callback(Common::IFFChunk &chunk) {
switch (chunk._type) {
- case MKID_BE('TEXT'):
+ case MKTAG('T','E','X','T'):
delete[] _scriptData->text;
_scriptData->text = new byte[chunk._size];
assert(_scriptData->text);
@@ -78,7 +78,7 @@ bool EMCInterpreter::callback(Common::IFFChunk &chunk) {
error("Couldn't read TEXT chunk from file '%s'", _filename);
break;
- case MKID_BE('ORDR'):
+ case MKTAG('O','R','D','R'):
delete[] _scriptData->ordr;
_scriptData->ordr = new uint16[chunk._size >> 1];
assert(_scriptData->ordr);
@@ -89,7 +89,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'):
delete[] _scriptData->data;
_scriptData->data = new uint16[chunk._size >> 1];
assert(_scriptData->data);
diff --git a/engines/toon/script.h b/engines/toon/script.h
index 2a74f9084f..b6d28e1171 100644
--- a/engines/toon/script.h
+++ b/engines/toon/script.h
@@ -87,9 +87,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;
}
};