diff options
author | Eugene Sandulenko | 2019-12-10 23:53:47 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-11 00:45:12 +0100 |
commit | 2c8b656bb395de39767712ea48f467098b11e3df (patch) | |
tree | 26dfeb2a8281094d360118443ced6dc1b1f02fef /engines/director/lingo | |
parent | c85e5a64d72e763954cec0edd389a5acdfe44cd1 (diff) | |
download | scummvm-rg350-2c8b656bb395de39767712ea48f467098b11e3df.tar.gz scummvm-rg350-2c8b656bb395de39767712ea48f467098b11e3df.tar.bz2 scummvm-rg350-2c8b656bb395de39767712ea48f467098b11e3df.zip |
DIRECTOR: LINGO: Added simpler mode for code preprocessor
Diffstat (limited to 'engines/director/lingo')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 9 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 69bae4542e..c998c37a11 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -249,7 +249,7 @@ static Common::String prevtok(const char *s, const char *lineStart, const char * return res; } -Common::String Lingo::codePreprocessor(const char *s) { +Common::String Lingo::codePreprocessor(const char *s, bool simple) { Common::String res; // Strip comments @@ -259,7 +259,9 @@ Common::String Lingo::codePreprocessor(const char *s) { s++; } - if (*s) + if (*s == '\r') + res += '\n'; + else if (*s) res += *s; s++; @@ -295,6 +297,9 @@ Common::String Lingo::codePreprocessor(const char *s) { s++; } + if (simple) + return res; + tmp = res; s = tmp.c_str(); res.clear(); diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 230d25074a..fd5d2f86e5 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -183,7 +183,7 @@ public: void runTests(); private: - Common::String codePreprocessor(const char *s); + Common::String codePreprocessor(const char *s, bool simple = false); const char *findNextDefinition(const char *s); // lingo-events.cpp |