diff options
author | uruk | 2014-05-09 13:11:50 +0200 |
---|---|---|
committer | uruk | 2014-05-09 13:11:50 +0200 |
commit | cb6548919712d91ae4cfbdefd20f6f0f147ced6c (patch) | |
tree | 18bc05eeac6b41c01e156311e20475886649cb24 /engines/cge2/fileio.cpp | |
parent | b674ab2a09bec35b27583d8c463d137ded285e52 (diff) | |
download | scummvm-rg350-cb6548919712d91ae4cfbdefd20f6f0f147ced6c.tar.gz scummvm-rg350-cb6548919712d91ae4cfbdefd20f6f0f147ced6c.tar.bz2 scummvm-rg350-cb6548919712d91ae4cfbdefd20f6f0f147ced6c.zip |
CGE2: Implement CGE2Engine::loadSprite().
Add Snail during the process and revise or expand a lot of other parts of the engine.
Diffstat (limited to 'engines/cge2/fileio.cpp')
-rw-r--r-- | engines/cge2/fileio.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/engines/cge2/fileio.cpp b/engines/cge2/fileio.cpp index 91a9954e94..6a20b6b561 100644 --- a/engines/cge2/fileio.cpp +++ b/engines/cge2/fileio.cpp @@ -245,15 +245,23 @@ 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); +int EncryptedStream::takeEnum(const char **tab, const char *text) { + if (text) { + for (const char **e = tab; *e; e++) { + if (scumm_stricmp(text, *e) == 0) { + return e - tab; } } } - return kIdNone; + return -1; +} + +ID EncryptedStream::ident(const char *s) { + return ID(takeEnum(kIdTab, s)); +} + +bool EncryptedStream::testBool(char *s) { + return number(s) != 0; } int32 EncryptedStream::size() { |