diff options
author | Eugene Sandulenko | 2016-08-11 19:37:42 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-11 19:50:25 +0200 |
commit | a13aa2620744b9bd6f82dd978e6788ee197b7605 (patch) | |
tree | cf5c07c5dfc8dd05cb0e7d00ec62a90aa6154037 /engines/director/lingo | |
parent | 22b6fec5f3e88d85bbcfa03abf0a5e502ac769f5 (diff) | |
download | scummvm-rg350-a13aa2620744b9bd6f82dd978e6788ee197b7605.tar.gz scummvm-rg350-a13aa2620744b9bd6f82dd978e6788ee197b7605.tar.bz2 scummvm-rg350-a13aa2620744b9bd6f82dd978e6788ee197b7605.zip |
DIRECTOR: Lingo: Code for calling out factory methods
Diffstat (limited to 'engines/director/lingo')
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 6 | ||||
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 5 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 3c888c1b09..f20d1bfe1c 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -634,7 +634,11 @@ void Lingo::factoryCall(Common::String &name, int nargs) { printStubWithArglist(s.c_str(), nargs); - dropStack(nargs); + Datum method = _stack[_stack.size() - nargs + 0]; + + s = name + "-" + *method.u.s; + + call(s, nargs); } } // End of namespace Director diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index fe2b82e5f9..0d4afca908 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -718,6 +718,11 @@ void Lingo::c_call() { g_lingo->_pc += g_lingo->calcStringAlignment(name.c_str()); int nargs = READ_UINT32(&(*g_lingo->_currentScript)[g_lingo->_pc++]); + + g_lingo->call(name, nargs); +} + +void Lingo::call(Common::String &name, int nargs) { bool drop = false; Symbol *sym; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index a51988c908..90adcbb972 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -240,6 +240,9 @@ public: static void c_ge(); static void c_le(); static void c_call(); + + void call(Common::String &name, int nargs); + static void c_procret(); static void c_mci(); |