diff options
-rw-r--r-- | engines/parallaction/graphics.cpp | 5 | ||||
-rw-r--r-- | engines/parallaction/parser.cpp | 11 | ||||
-rw-r--r-- | engines/parallaction/parser.h | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index aca02a68bf..699ec5cbc5 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -608,7 +608,7 @@ bool Gfx::displayWrappedString(char *text, uint16 x, uint16 y, byte color, uint1 while (strlen(text) > 0) { - text = parseNextToken(text, token, 40, " "); + text = parseNextToken(text, token, 40, " ", true); linewidth += getStringWidth(token); if (linewidth > wrapwidth) { @@ -653,7 +653,8 @@ void Gfx::getStringExtent(char *text, uint16 maxwidth, int16* width, int16* heig while (strlen(text) != 0) { - text = parseNextToken(text, token, 40, " "); + text = parseNextToken(text, token, 40, " ", true); + printf("%s\n", text); w += getStringWidth(token); if (w > maxwidth) { diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index 6fd21b3099..44aae6c1cc 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -127,7 +127,7 @@ void clearTokens() { // // The routine returns the unparsed portion of the input string 's'. // -char *parseNextToken(char *s, char *tok, uint16 count, const char *brk) { +char *parseNextToken(char *s, char *tok, uint16 count, const char *brk, bool ignoreQuotes) { enum STATES { NORMAL, QUOTED }; @@ -150,8 +150,13 @@ char *parseNextToken(char *s, char *tok, uint16 count, const char *brk) { } if (*s == '"') { - state = QUOTED; - s++; + if (ignoreQuotes) { + *tok++ = *s++; + count--; + } else { + state = QUOTED; + s++; + } } else { *tok++ = *s++; count--; diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index e27095bd16..aa3929a52c 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -33,7 +33,7 @@ namespace Parallaction { uint16 fillBuffers(Common::SeekableReadStream &stream, bool errorOnEOF = false); -char *parseNextToken(char *s, char *tok, uint16 count, const char *brk); +char *parseNextToken(char *s, char *tok, uint16 count, const char *brk, bool ignoreQuotes = false); extern char _tokens[][40]; |