diff --git a/engines/cge2/fileio.cpp b/engines/cge2/fileio.cpp index 6cc9f8b8ded9..91a9954e9481 100644 --- a/engines/cge2/fileio.cpp +++ b/engines/cge2/fileio.cpp @@ -245,6 +245,17 @@ char *EncryptedStream::token(char *s) { return strtok(s, " =\t,;/()"); } +ID EncryptedStream::ident(const char *s) { + if (s) { + for (const char **e = kIdTab; *e; e++) { + if (scumm_stricmp(s, *e) == 0) { + return ID(e - kIdTab); + } + } + } + return kIdNone; +} + int32 EncryptedStream::size() { return _readStream->size(); } @@ -261,6 +272,7 @@ const char *EncryptedStream::kIdTab[] = { "[near]", "[mtake]", "[ftake]", "[phase]", "[seq]", "Name", "Type", "Front", "East", "Portable", "Transparent", - NULL }; + NULL +}; } // End of namespace CGE2 diff --git a/engines/cge2/fileio.h b/engines/cge2/fileio.h index 0d32cab3c217..fdf1b8325efa 100644 --- a/engines/cge2/fileio.h +++ b/engines/cge2/fileio.h @@ -45,6 +45,13 @@ class CGE2Engine; #define kDatName "VOL.DAT" #define kCryptSeed 0xA5 +enum ID { + kIdNear, kIdMTake, kIdFTake, kIdPhase, kIdSeq, + kIdName, kIdType, kIdFront, kIdEast, + kIdPortable, kIdTransparent, + kIdNone +}; + struct BtKeypack { char _key[kBtKeySize]; uint32 _pos; @@ -119,6 +126,7 @@ class EncryptedStream { Common::String readLine(); static int number(char *s); static char *token(char *s); + static ID ident(const char *s); int getLineCount() { return _lineCount; } };