diff options
-rw-r--r-- | engines/cge2/cge2_main.cpp | 28 | ||||
-rw-r--r-- | engines/cge2/fileio.cpp | 4 | ||||
-rw-r--r-- | engines/cge2/fileio.h | 3 |
3 files changed, 20 insertions, 15 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 34946c7c4b..40dd98585b 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -63,39 +63,39 @@ void CGE2Engine::loadScript(const char *fname) { ok = false; // not OK if break // sprite ident number - if ((p = strtok(tmpStr, " \t\n")) == NULL) + if ((p = EncryptedStream::token(tmpStr)) == NULL) break; - int SpI = scrf.number(p); + int SpI = EncryptedStream::number(p); // sprite file name char *SpN; - if ((SpN = strtok(NULL, " ,;/\t\n")) == NULL) + if ((SpN = EncryptedStream::token(NULL)) == NULL) break; // sprite scene - if ((p = strtok(NULL, " ,;/\t\n")) == NULL) + if ((p = EncryptedStream::token(NULL)) == NULL) break; - int SpA = scrf.number(p); + int SpA = EncryptedStream::number(p); // sprite column - if ((p = strtok(NULL, " ,;/\t\n")) == NULL) + if ((p = EncryptedStream::token(NULL)) == NULL) break; - int SpX = scrf.number(p); + int SpX = EncryptedStream::number(p); // sprite row - if ((p = strtok(NULL, " ,;/\t\n")) == NULL) + if ((p = EncryptedStream::token(NULL)) == NULL) break; - int SpY = scrf.number(p); + int SpY = EncryptedStream::number(p); // sprite Z pos - if ((p = strtok(NULL, " ,;/\t\n")) == NULL) + if ((p = EncryptedStream::token(NULL)) == NULL) break; - int SpZ = scrf.number(p); + int SpZ = EncryptedStream::number(p); // sprite life - if ((p = strtok(NULL, " ,;/\t\n")) == NULL) + if ((p = EncryptedStream::token(NULL)) == NULL) break; - bool BkG = scrf.number(p) == 0; + bool BkG = EncryptedStream::number(p) == 0; ok = true; // no break: OK @@ -126,7 +126,7 @@ void CGE2Engine::movie(const char *ext) { _now = atoi(ext + 1); loadScript(fn); - warning("STUB: CGE2Engine::movie()"); + warning("STUB: CGE2Engine::movie()"); _now = now; } diff --git a/engines/cge2/fileio.cpp b/engines/cge2/fileio.cpp index fb39cd3ad7..7677699fed 100644 --- a/engines/cge2/fileio.cpp +++ b/engines/cge2/fileio.cpp @@ -240,6 +240,10 @@ int EncryptedStream::number(char *s) { return r; } +char *EncryptedStream::token(char *s) { + return strtok(s, " =\t,;/()"); +} + int32 EncryptedStream::size() { return _readStream->size(); } diff --git a/engines/cge2/fileio.h b/engines/cge2/fileio.h index 0597c6ac08..a596d71341 100644 --- a/engines/cge2/fileio.h +++ b/engines/cge2/fileio.h @@ -113,7 +113,8 @@ public: int32 size(); uint32 read(byte *dataPtr, uint32 dataSize); Common::String readLine(); - int number(char *s); + static int number(char *s); + static char *token(char *s); }; } // End of namespace CGE2 |