diff options
author | uruk | 2014-05-05 20:31:21 +0200 |
---|---|---|
committer | uruk | 2014-05-05 20:31:21 +0200 |
commit | a0c5805c8efba2e184b737dc7869092318743004 (patch) | |
tree | 46dd164be2e23215701c494007882812e7ae2185 /engines/cge2 | |
parent | b595d9ee0a66c3a8980b0c513529bd0ff0ffe5b5 (diff) | |
download | scummvm-rg350-a0c5805c8efba2e184b737dc7869092318743004.tar.gz scummvm-rg350-a0c5805c8efba2e184b737dc7869092318743004.tar.bz2 scummvm-rg350-a0c5805c8efba2e184b737dc7869092318743004.zip |
CGE2: Read identifiers properly in Text::load().
Diffstat (limited to 'engines/cge2')
-rw-r--r-- | engines/cge2/fileio.cpp | 8 | ||||
-rw-r--r-- | engines/cge2/fileio.h | 1 | ||||
-rw-r--r-- | engines/cge2/text.cpp | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/engines/cge2/fileio.cpp b/engines/cge2/fileio.cpp index 4da2c52cfa..fb39cd3ad7 100644 --- a/engines/cge2/fileio.cpp +++ b/engines/cge2/fileio.cpp @@ -232,6 +232,14 @@ Common::String EncryptedStream::readLine() { return _readStream->readLine(); } +int EncryptedStream::number(char *s) { + int r = atoi(s); + char *pp = strchr(s, ':'); + if (pp) + r = (r << 8) + atoi(pp + 1); + return r; +} + int32 EncryptedStream::size() { return _readStream->size(); } diff --git a/engines/cge2/fileio.h b/engines/cge2/fileio.h index 42bb2ee352..0597c6ac08 100644 --- a/engines/cge2/fileio.h +++ b/engines/cge2/fileio.h @@ -113,6 +113,7 @@ public: int32 size(); uint32 read(byte *dataPtr, uint32 dataSize); Common::String readLine(); + int number(char *s); }; } // End of namespace CGE2 diff --git a/engines/cge2/text.cpp b/engines/cge2/text.cpp index e65c19f202..de33717c55 100644 --- a/engines/cge2/text.cpp +++ b/engines/cge2/text.cpp @@ -107,7 +107,7 @@ void Text::load() { if (!Common::isDigit(*s)) continue; - int r = atoi(s); + int r = tf.number(s); s += strlen(s); if (s < tmpStr + n) |