diff options
author | Eugene Sandulenko | 2016-08-09 22:11:25 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-09 22:37:35 +0200 |
commit | c7b8689c6c25f5c176629de04acf79db3afa8096 (patch) | |
tree | 99aa294ae3d05af3fc908ff94c1ebbf09f0d17b7 | |
parent | 2dd109c4838a82f8a4976aede8125b3c9fff05c1 (diff) | |
download | scummvm-rg350-c7b8689c6c25f5c176629de04acf79db3afa8096.tar.gz scummvm-rg350-c7b8689c6c25f5c176629de04acf79db3afa8096.tar.bz2 scummvm-rg350-c7b8689c6c25f5c176629de04acf79db3afa8096.zip |
DIRECTOR: Lingo: Proper stubs for commands with variable arguments
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 58 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 3 |
2 files changed, 53 insertions, 8 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 7ecb5ccf74..6981e1c33b 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -122,6 +122,32 @@ void Lingo::initBuiltIns() { } } +void Lingo::printStubWithArglist(const char *funcname, int nargs) { + Common::String s(funcname); + + s += '('; + + for (int i = 0; i < nargs; i++) { + Datum d = _stack[_stack.size() - nargs + i]; + + d.toString(); + s += *d.u.s; + + if (i != nargs - 1) + s += ", "; + } + + s += ")"; + + warning("STUB: %s", s.c_str()); +} + +void Lingo::dropStack(int nargs) { + for (int i = 0; i < nargs; i++) + pop(); +} + + /////////////////// // Math /////////////////// @@ -382,11 +408,15 @@ void Lingo::b_pause(int nargs) { } void Lingo::b_playAccel(int nargs) { - warning("STUB: b_playAccel"); + g_lingo->printStubWithArglist("b_playAccel", nargs); + + g_lingo->dropStack(nargs); } void Lingo::b_printFrom(int nargs) { - warning("STUB: b_printFrom"); + g_lingo->printStubWithArglist("b_printFrom", nargs); + + g_lingo->dropStack(nargs); } void Lingo::b_quit(int nargs) { @@ -464,15 +494,21 @@ void Lingo::b_moveableSprite(int nargs) { } void Lingo::b_puppetPalette(int nargs) { - warning("STUB: b_puppetPalette"); + g_lingo->printStubWithArglist("b_puppetPalette", nargs); + + g_lingo->dropStack(nargs); } void Lingo::b_puppetSound(int nargs) { - warning("STUB: b_puppetSound"); + g_lingo->printStubWithArglist("b_puppetSound", nargs); + + g_lingo->dropStack(nargs); } void Lingo::b_puppetSprite(int nargs) { - warning("STUB: b_puppetSprite"); + g_lingo->printStubWithArglist("b_puppetSprite", nargs); + + g_lingo->dropStack(nargs); } void Lingo::b_puppetTempo(int nargs) { @@ -481,15 +517,21 @@ void Lingo::b_puppetTempo(int nargs) { } void Lingo::b_puppetTransition(int nargs) { - warning("STUB: b_puppetTransition"); + g_lingo->printStubWithArglist("b_puppetTransition", nargs); + + g_lingo->dropStack(nargs); } void Lingo::b_spriteBox(int nargs) { - warning("STUB: b_spriteBox"); + g_lingo->printStubWithArglist("b_spriteBox", nargs); + + g_lingo->dropStack(nargs); } void Lingo::b_zoomBox(int nargs) { - warning("STUB: b_zoomBox"); + g_lingo->printStubWithArglist("b_zoomBox", nargs); + + g_lingo->dropStack(nargs); } diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 186f8ccc79..2bc1c59362 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -255,6 +255,9 @@ public: static void c_open(); + void printStubWithArglist(const char *funcname, int nargs); + void dropStack(int nargs); + static void b_abs(int nargs); static void b_atan(int nargs); static void b_chars(int nargs); |