aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
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/m4
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/m4')
-rw-r--r--engines/m4/assets.h16
-rw-r--r--engines/m4/converse.cpp48
-rw-r--r--engines/m4/font.cpp8
3 files changed, 36 insertions, 36 deletions
diff --git a/engines/m4/assets.h b/engines/m4/assets.h
index 3ae7fb2e22..940646b5f2 100644
--- a/engines/m4/assets.h
+++ b/engines/m4/assets.h
@@ -33,16 +33,16 @@
namespace M4 {
// Sequence chunks
-#define CHUNK_SCEN MKID_BE('SCEN')
-#define CHUNK_MACH MKID_BE('MACH')
-#define CHUNK_SEQU MKID_BE('SEQU')
-#define CHUNK_DATA MKID_BE('DATA')
-#define CHUNK_CELS MKID_BE('CELS')
+#define CHUNK_SCEN MKTAG('S','C','E','N')
+#define CHUNK_MACH MKTAG('M','A','C','H')
+#define CHUNK_SEQU MKTAG('S','E','Q','U')
+#define CHUNK_DATA MKTAG('D','A','T','A')
+#define CHUNK_CELS MKTAG('C','E','L','S')
// Sprite chunks
-#define HEAD_M4SS MKID_BE('M4SS') //'M4SS'
-#define CELS__PAL MKID_BE(' PAL') //' PAL'
-#define CELS___SS MKID_BE(' SS') //' SS'
+#define HEAD_M4SS MKTAG('M','4','S','S') //'M4SS'
+#define CELS__PAL MKTAG(' ','P','A','L') //' PAL'
+#define CELS___SS MKTAG(' ',' ','S','S') //' SS'
#define SPRITE_SET_CHAR_INFO 4
diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp
index 70c30d28f2..2d1b8e7e4f 100644
--- a/engines/m4/converse.cpp
+++ b/engines/m4/converse.cpp
@@ -45,35 +45,35 @@ namespace M4 {
// Conversation chunks
// Header
-#define HEAD_CONV MKID_BE('CONV') // conversation
-#define CHUNK_DECL MKID_BE('DECL') // declaration
-#define CHUNK_NODE MKID_BE('NODE') // node
-#define CHUNK_LNOD MKID_BE('LNOD') // linear node
-#define CHUNK_ETRY MKID_BE('ETRY') // entry
-#define CHUNK_TEXT MKID_BE('TEXT') // text
-#define CHUNK_MESG MKID_BE('MESG') // message
+#define HEAD_CONV MKTAG('C','O','N','V') // conversation
+#define CHUNK_DECL MKTAG('D','E','C','L') // declaration
+#define CHUNK_NODE MKTAG('N','O','D','E') // node
+#define CHUNK_LNOD MKTAG('L','N','O','D') // linear node
+#define CHUNK_ETRY MKTAG('E','T','R','Y') // entry
+#define CHUNK_TEXT MKTAG('T','E','X','T') // text
+#define CHUNK_MESG MKTAG('M','E','S','G') // message
// Conversation chunks - entry related (unconditional)
-#define CHUNK_RPLY MKID_BE('RPLY') // reply
-#define CHUNK_HIDE MKID_BE('HIDE') // hide entry
-#define CHUNK_UHID MKID_BE('UHID') // unhide entry
-#define CHUNK_DSTR MKID_BE('DSTR') // destroy entry
+#define CHUNK_RPLY MKTAG('R','P','L','Y') // reply
+#define CHUNK_HIDE MKTAG('H','I','D','E') // hide entry
+#define CHUNK_UHID MKTAG('U','H','I','D') // unhide entry
+#define CHUNK_DSTR MKTAG('D','S','T','R') // destroy entry
// Conversation chunks - entry related (conditional)
-#define CHUNK_CRPL MKID_BE('CRPL') // reply
-#define CHUNK_CHDE MKID_BE('CHDE') // hide entry
-#define CHUNK_CUHD MKID_BE('CUHD') // unhide entry
-#define CHUNK_CDST MKID_BE('DDTS') // destroy entry
+#define CHUNK_CRPL MKTAG('C','R','P','L') // reply
+#define CHUNK_CHDE MKTAG('C','H','D','E') // hide entry
+#define CHUNK_CUHD MKTAG('C','U','H','D') // unhide entry
+#define CHUNK_CDST MKTAG('D','D','T','S') // destroy entry
// Conversation chunks - branching and logic (unconditional)
-#define CHUNK_ASGN MKID_BE('ASGN') // assign
-#define CHUNK_GOTO MKID_BE('GOTO') // goto chunk
-#define CHUNK_EXIT MKID_BE('EXIT') // exit/return from goto
+#define CHUNK_ASGN MKTAG('A','S','G','N') // assign
+#define CHUNK_GOTO MKTAG('G','O','T','O') // goto chunk
+#define CHUNK_EXIT MKTAG('E','X','I','T') // exit/return from goto
// Conversation chunks - branching and logic (conditional)
-#define CHUNK_CASN MKID_BE('CASN') // assign
-#define CHUNK_CCGO MKID_BE('CCGO') // goto chunk
-#define CHUNK_CEGO MKID_BE('CEGO') // exit/return from goto
+#define CHUNK_CASN MKTAG('C','A','S','N') // assign
+#define CHUNK_CCGO MKTAG('C','C','G','O') // goto chunk
+#define CHUNK_CEGO MKTAG('C','E','G','O') // exit/return from goto
// Others
-#define CHUNK_FALL MKID_BE('FALL') // fallthrough
-#define CHUNK_WRPL MKID_BE('WRPL') // weighted reply chunk
-#define CHUNK_WPRL MKID_BE('WPRL') // weighted preply chunk
+#define CHUNK_FALL MKTAG('F','A','L','L') // fallthrough
+#define CHUNK_WRPL MKTAG('W','R','P','L') // weighted reply chunk
+#define CHUNK_WPRL MKTAG('W','P','R','L') // weighted preply chunk
ConversationView::ConversationView(MadsM4Engine *vm): View(vm, Common::Rect(0,
diff --git a/engines/m4/font.cpp b/engines/m4/font.cpp
index cba32c2225..3ed419675d 100644
--- a/engines/m4/font.cpp
+++ b/engines/m4/font.cpp
@@ -81,7 +81,7 @@ Font::Font(MadsM4Engine *vm, const char *filename) : _vm(vm) {
void Font::setFontM4(const char *filename) {
Common::SeekableReadStream *fontFile = _vm->res()->openFile(filename);
- if (fontFile->readUint32LE() != MKID_BE('FONT')) {
+ if (fontFile->readUint32LE() != MKTAG('F','O','N','T')) {
debugCN(kDebugGraphics, "Font::Font: FONT tag expected\n");
return;
}
@@ -92,7 +92,7 @@ void Font::setFontM4(const char *filename) {
//debugCN(kDebugGraphics, "Font::Font: _maxWidth = %d, _maxHeight = %d, fontSize = %d\n", _maxWidth, _maxHeight, fontSize);
- if (fontFile->readUint32LE() != MKID_BE('WIDT')) {
+ if (fontFile->readUint32LE() != MKTAG('W','I','D','T')) {
debugCN(kDebugGraphics, "Font::Font: WIDT tag expected\n");
return;
}
@@ -100,7 +100,7 @@ void Font::setFontM4(const char *filename) {
_charWidths = new uint8[256];
fontFile->read(_charWidths, 256);
- if (fontFile->readUint32LE() != MKID_BE('OFFS')) {
+ if (fontFile->readUint32LE() != MKTAG('O','F','F','S')) {
debugCN(kDebugGraphics, "Font::Font: OFFS tag expected\n");
return;
}
@@ -110,7 +110,7 @@ void Font::setFontM4(const char *filename) {
for (int i = 0; i < 256; i++)
_charOffs[i] = fontFile->readUint16LE();
- if (fontFile->readUint32LE() != MKID_BE('PIXS')) {
+ if (fontFile->readUint32LE() != MKTAG('P','I','X','S')) {
debugCN(kDebugGraphics, "Font::Font: PIXS tag expected\n");
return;
}