aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo
diff options
context:
space:
mode:
authorScott Percival2019-12-16 23:13:04 +0800
committerScott Percival2019-12-17 22:58:52 +0800
commit36dafaf6dfecb40f05b1a9e4dfb402d45ae7b50e (patch)
treec53b9b85ec536ad24b8655eeced1814163afbfc9 /engines/director/lingo
parentff8c089baef318ee5e72b04df8fde40653315d3b (diff)
downloadscummvm-rg350-36dafaf6dfecb40f05b1a9e4dfb402d45ae7b50e.tar.gz
scummvm-rg350-36dafaf6dfecb40f05b1a9e4dfb402d45ae7b50e.tar.bz2
scummvm-rg350-36dafaf6dfecb40f05b1a9e4dfb402d45ae7b50e.zip
DIRECTOR: LINGO: Implement b_go
Diffstat (limited to 'engines/director/lingo')
-rw-r--r--engines/director/lingo/lingo-builtins.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 8b741a6236..f0e384d92c 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -893,9 +893,40 @@ void Lingo::b_do(int nargs) {
}
void Lingo::b_go(int nargs) {
- g_lingo->printSTUBWithArglist("b_go", nargs);
+ if (nargs >= 1 && nargs <= 2) {
+ Datum frame = g_lingo->pop();
+ nargs -= 1;
+ if (frame.type == STRING) {
+ if (*frame.u.s == "loop") {
+ g_lingo->func_gotoloop();
+ } else if (*frame.u.s == "next") {
+ g_lingo->func_gotonext();
+ } else if (*frame.u.s == "previous") {
+ g_lingo->func_gotoprevious();
+ } else {
+ Datum movie;
+ if (nargs > 0) {
+ movie = g_lingo->pop();
+ nargs -= 1;
+ if (movie.type != STRING) {
+ warning("b_go: movie arg should be of type STRING, not %s", movie.type2str());
+ }
+ }
+ g_lingo->func_goto(frame, movie);
+ }
+ if (nargs > 0) {
+ warning("b_go: ignoring %d extra args", nargs);
+ g_lingo->dropStack(nargs);
+ }
- g_lingo->dropStack(nargs);
+ } else {
+ warning("b_go: frame arg should be of type STRING, not %s", frame.type2str());
+ g_lingo->dropStack(nargs);
+ }
+ } else {
+ warning("b_go: expected 1 or 2 args, not %d", nargs);
+ g_lingo->dropStack(nargs);
+ }
}
void Lingo::b_halt(int nargs) {