diff options
author | Eugene Sandulenko | 2016-07-10 15:24:00 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | aa45e48355e670b2d8807515fa3158c0a130fcfb (patch) | |
tree | 3103dd0aedccf32210830978a712938b1be43d0d /engines/director/lingo/lingo.cpp | |
parent | 855db111fcfca11224f77255a01bef50eb386961 (diff) | |
download | scummvm-rg350-aa45e48355e670b2d8807515fa3158c0a130fcfb.tar.gz scummvm-rg350-aa45e48355e670b2d8807515fa3158c0a130fcfb.tar.bz2 scummvm-rg350-aa45e48355e670b2d8807515fa3158c0a130fcfb.zip |
DIRECTOR: Lingo: Better error recovery and further work on if() statements
Diffstat (limited to 'engines/director/lingo/lingo.cpp')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index dd3d0cde19..09e3805426 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -91,6 +91,8 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) { _linenumber = _colnumber = 0; + _hadError = false; + _floatPrecision = 4; _floatPrecisionFormat = "%.4f"; @@ -112,6 +114,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) { _scripts[type][id] = _currentScript; _linenumber = _colnumber = 1; + _hadError = false; const char *begin, *end; @@ -126,7 +129,9 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) { begin = code; first = false; } - Common::String chunk(begin, end); + Common::String chunk(begin, end + 1); + + debug(2, "Code chunk\n#####\n%s#####", chunk.c_str()); parse(chunk.c_str()); @@ -135,6 +140,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) { begin = end + 1; } + _hadError = false; parse(begin); } else { parse(code); @@ -315,8 +321,13 @@ void Lingo::runTests() { warning("Executing file %s of size %d", m.getName().c_str(), size); + _hadError = false; addCode(script, kMovieScript, counter); - executeScript(kMovieScript, counter); + + if (!_hadError) + executeScript(kMovieScript, counter); + else + warning("Skipping execution"); free(script); |