diff options
author | Eugene Sandulenko | 2016-06-29 14:39:57 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 0f65b9abb3d671f1ffd9cd1089fca055ce24d4db (patch) | |
tree | cf24577190ab1b888866d43681216a23db914627 /engines/director/lingo | |
parent | bba7efff11ee5f42731495a43128dbaa909e22b1 (diff) | |
download | scummvm-rg350-0f65b9abb3d671f1ffd9cd1089fca055ce24d4db.tar.gz scummvm-rg350-0f65b9abb3d671f1ffd9cd1089fca055ce24d4db.tar.bz2 scummvm-rg350-0f65b9abb3d671f1ffd9cd1089fca055ce24d4db.zip |
DIRECTOR: Lingo: Stub for context creation
Diffstat (limited to 'engines/director/lingo')
-rw-r--r-- | engines/director/lingo/lingo-codegen.cpp | 10 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index 8473f2e8a0..b5bc8014c1 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -64,6 +64,16 @@ void Lingo::execute(int pc) { } } +void Lingo::pushContext() { + Context *con = new Context; + + _contexts.push_back(con); +} + +void Lingo::popContext() { + _contexts.pop_back(); +} + Symbol *Lingo::lookupVar(const char *name, bool create, bool putInLocalList) { Symbol *sym; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index becd41002a..bec14f2b59 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -113,6 +113,11 @@ typedef Common::HashMap<int32, ScriptData *> ScriptHash; typedef Common::Array<Datum> StackData; typedef Common::HashMap<Common::String, Symbol *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> SymbolHash; +struct Context { /* execution context */ + Symbol *handler; + SymbolHash *localvars; +}; + class Lingo { public: Lingo(DirectorEngine *vm); @@ -135,6 +140,8 @@ public: public: void execute(int pc); + void pushContext(); + void popContext(); Symbol *lookupVar(const char *name, bool create = true, bool putInLocalList = true); void define(Common::String &s, int start, int nargs); void codeArg(Common::String *s); @@ -205,6 +212,8 @@ private: Common::HashMap<Common::String, bool, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _localvars; SymbolHash _handlers; + Common::Array<Context *> _contexts; + int _pc; StackData _stack; |