Skip to content

Commit

Permalink
DIRECTOR: Lingo: Stub for context creation
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 3, 2016
1 parent bba7eff commit 0f65b9a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions engines/director/lingo/lingo-codegen.cpp
Expand Up @@ -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;

Expand Down
9 changes: 9 additions & 0 deletions engines/director/lingo/lingo.h
Expand Up @@ -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);
Expand All @@ -135,6 +140,8 @@ class Lingo {

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);
Expand Down Expand Up @@ -205,6 +212,8 @@ class Lingo {
Common::HashMap<Common::String, bool, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _localvars;
SymbolHash _handlers;

Common::Array<Context *> _contexts;

int _pc;

StackData _stack;
Expand Down

0 comments on commit 0f65b9a

Please sign in to comment.