Skip to content

Commit

Permalink
DIRECTOR: Lingo: Initial implementation of c_procret()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 3, 2016
1 parent 3d543c6 commit 125600a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions engines/director/lingo/lingo-code.cpp
Expand Up @@ -458,11 +458,18 @@ void Lingo::c_call() {
g_lingo->_currentScript = sym->u.defn;
g_lingo->execute(0);

g_lingo->_returning = 0;
g_lingo->_returning = false;
}

void Lingo::c_procret() {
warning("STUB: c_procret()");
CFrame *fp = g_lingo->_callstack.back();

g_lingo->_currentScript = fp->retscript;
g_lingo->_pc = fp->retpc;

delete fp;

g_lingo->_returning = true;
}

}
2 changes: 2 additions & 0 deletions engines/director/lingo/lingo.cpp
Expand Up @@ -81,6 +81,7 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
_eventHandlerTypes[t->handler] = t->name;

_currentScript = 0;
_currentScriptType = kMovieScript;
_pc = 0;
_returning = false;
_indef = false;
Expand Down Expand Up @@ -118,6 +119,7 @@ void Lingo::addCode(Common::String code, ScriptType type, uint16 id) {
}

_currentScript = new ScriptData;
_currentScriptType = type;
_scripts[type][id] = _currentScript;

parse(code.c_str());
Expand Down
1 change: 1 addition & 0 deletions engines/director/lingo/lingo.h
Expand Up @@ -172,6 +172,7 @@ class Lingo {

public:
ScriptData *_currentScript;
ScriptType _currentScriptType;
bool _returning;
bool _indef;

Expand Down

0 comments on commit 125600a

Please sign in to comment.