From 0f65b9abb3d671f1ffd9cd1089fca055ce24d4db Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 29 Jun 2016 14:39:57 +0200 Subject: DIRECTOR: Lingo: Stub for context creation --- engines/director/lingo/lingo-codegen.cpp | 10 ++++++++++ engines/director/lingo/lingo.h | 9 +++++++++ 2 files changed, 19 insertions(+) (limited to 'engines/director/lingo') 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 ScriptHash; typedef Common::Array StackData; typedef Common::HashMap 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 _localvars; SymbolHash _handlers; + Common::Array _contexts; + int _pc; StackData _stack; -- cgit v1.2.3