aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cge2')
-rw-r--r--engines/cge2/fileio.cpp8
-rw-r--r--engines/cge2/fileio.h1
-rw-r--r--engines/cge2/text.cpp2
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)