aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2014-05-08 19:04:52 +0200
committeruruk2014-05-08 19:04:52 +0200
commit9ffdff539203cf2774317bd274ae606a47148037 (patch)
tree358e338396f474750b8e7d441e5976ec96f2c526 /engines
parentd12e25ccd0114726a3cf04324f06cbbb14e8fa48 (diff)
downloadscummvm-rg350-9ffdff539203cf2774317bd274ae606a47148037.tar.gz
scummvm-rg350-9ffdff539203cf2774317bd274ae606a47148037.tar.bz2
scummvm-rg350-9ffdff539203cf2774317bd274ae606a47148037.zip
CGE2: Implement EncryptedStream::ident().
Diffstat (limited to 'engines')
-rw-r--r--engines/cge2/fileio.cpp14
-rw-r--r--engines/cge2/fileio.h8
2 files changed, 21 insertions, 1 deletions
diff --git a/engines/cge2/fileio.cpp b/engines/cge2/fileio.cpp
index 6cc9f8b8de..91a9954e94 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 0d32cab3c2..fdf1b8325e 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 @@ public:
Common::String readLine();
static int number(char *s);
static char *token(char *s);
+ static ID ident(const char *s);
int getLineCount() { return _lineCount; }
};