diff options
author | Nicola Mettifogo | 2007-02-20 09:52:07 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-02-20 09:52:07 +0000 |
commit | b6a10e10ef52820d92940f16775e5ae1d84388e1 (patch) | |
tree | 2c403e08bb704b9b3d1b5cdf83d1df82ed580c60 /engines/parallaction/parser.cpp | |
parent | 5886d3ed7f6bdcc957174d33a3f31bcd68a9739f (diff) | |
download | scummvm-rg350-b6a10e10ef52820d92940f16775e5ae1d84388e1.tar.gz scummvm-rg350-b6a10e10ef52820d92940f16775e5ae1d84388e1.tar.bz2 scummvm-rg350-b6a10e10ef52820d92940f16775e5ae1d84388e1.zip |
changed parseComment to use Script stream instead of file
svn-id: r25739
Diffstat (limited to 'engines/parallaction/parser.cpp')
-rw-r--r-- | engines/parallaction/parser.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index ead9383a2e..f8c9d3293a 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -74,38 +74,18 @@ void Script::seek(int32 offset, int whence) { error("seek not supported on Script streams"); } -// looks for next token in a string -// -// scans 's' until one of the stop-chars in 'brk' is found -// builds a token and return the part of the string which hasn't been parsed - -char *parseNextToken(char *s, char *tok, uint16 count, const char *brk) { - - while (*s != '\0') { - - if (brk[0] == *s) break; - if (brk[1] == *s) break; - if (brk[2] == *s) break; - - *tok++ = *s++; - } - - *tok = '\0'; - return s; -} - // // a comment can appear both at location and Zone levels // comments are displayed into rectangles on the screen // -char *Parallaction::parseComment(ArchivedFile *file) { +char *Parallaction::parseComment(Script &script) { char _tmp_comment[1000] = "\0"; char *v194; do { char v190[400]; - v194 = _locationScript->readLine(v190, 400); + v194 = script.readLine(v190, 400); v194[strlen(v194)-1] = '\0'; if (!scumm_stricmp(v194, "endtext")) @@ -131,6 +111,26 @@ void clearTokens() { } +// looks for next token in a string +// +// scans 's' until one of the stop-chars in 'brk' is found +// builds a token and return the part of the string which hasn't been parsed + +char *parseNextToken(char *s, char *tok, uint16 count, const char *brk) { + + while (*s != '\0') { + + if (brk[0] == *s) break; + if (brk[1] == *s) break; + if (brk[2] == *s) break; + + *tok++ = *s++; + } + + *tok = '\0'; + return s; +} + uint16 fillTokens(char* line) { uint16 i = 0; |