[Scummvm-git-logs] scummvm master -> 8d29257e999b09b09627f2a9b265188164212ba0

djsrv dservilla at gmail.com
Tue Jul 28 15:33:47 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8d29257e99 DIRECTOR: LINGO: Implement tell


Commit: 8d29257e999b09b09627f2a9b265188164212ba0
    https://github.com/scummvm/scummvm/commit/8d29257e999b09b09627f2a9b265188164212ba0
Author: djsrv (dservilla at gmail.com)
Date: 2020-07-28T11:33:19-04:00

Commit Message:
DIRECTOR: LINGO: Implement tell

Changed paths:
    engines/director/director.h
    engines/director/lingo/lingo-bytecode.cpp
    engines/director/lingo/lingo-code.cpp
    engines/director/lingo/lingo-code.h


diff --git a/engines/director/director.h b/engines/director/director.h
index 6751d9c567..c4574290da 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -180,6 +180,7 @@ public:
 	Lingo *getLingo() const { return _lingo; }
 	Stage *getMainStage() const { return _mainStage; }
 	Stage *getCurrentStage() const { return _currentStage; }
+	void setCurrentStage(Stage *stage) { _currentStage = stage; };
 	Movie *getCurrentMovie() const;
 	void setCurrentMovie(Movie *movie);
 	Common::String getCurrentPath() const;
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index 04ae42760f..cf9244ef29 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -102,7 +102,7 @@ static LingoV4Bytecode lingoV4[] = {
 	{ 0x60, LC::cb_theassign2,	"b" },
 	{ 0x61, LC::cb_objectfieldpush, "b" },
 	{ 0x62, LC::cb_objectfieldassign, "b" },
-	{ 0x63, LC::cb_tellcall,	"b" },
+	{ 0x63, LC::cb_call,		"b" }, // tellcall
 	{ 0x64, LC::c_stackpeek, 	"b" },
 	{ 0x65, LC::c_stackdrop, 	"b" },
 	{ 0x66, LC::cb_v4theentitynamepush, "b" },
@@ -595,23 +595,6 @@ void LC::cb_objectpush() {
 	g_lingo->push(result);
 }
 
-void LC::cb_tellcall() {
-	int nameId = g_lingo->readInt();
-	Common::String name = g_lingo->_currentArchive->getName(nameId);
-	warning("STUB: cb_tellcall(%s)", name.c_str());
-
-	Datum nargs = g_lingo->pop();
-	if ((nargs.type == ARGC) || (nargs.type == ARGCNORET)) {
-		//LC::call(name, nargs.u.i);
-		for (int i = 0; i < nargs.u.i; i++) {
-			g_lingo->pop();
-		}
-	} else {
-		warning("cb_tellcall: first arg should be of type ARGC or ARGCNORET, not %s", nargs.type2str());
-	}
-
-}
-
 void LC::cb_theassign() {
 	int nameId = g_lingo->readInt();
 	Common::String name = g_lingo->_currentArchive->getName(nameId);
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 4ae32771e1..98813f9430 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -47,6 +47,7 @@
 #include "director/movie.h"
 #include "director/score.h"
 #include "director/sprite.h"
+#include "director/stage.h"
 #include "director/cursor.h"
 #include "director/channel.h"
 #include "director/util.h"
@@ -148,7 +149,6 @@ static struct FuncDescr {
 	{ LC::cb_objectfieldassign, "cb_objectfieldassign", "N" },
 	{ LC::cb_objectfieldpush, "cb_objectfieldpush", "N" },
 	{ LC::cb_objectpush,	"cb_objectpush",	"N" },
-	{ LC::cb_tellcall,		"cb_tellcall",		"N" },
 	{ LC::cb_theassign,		"cb_theassign",		"N" },
 	{ LC::cb_theassign2,	"cb_theassign2",	"N" },
 	{ LC::cb_thepush,		"cb_thepush",		"N" },
@@ -1335,12 +1335,24 @@ void LC::c_whencode() {
 }
 
 void LC::c_tell() {
-	Datum d1 = g_lingo->pop();
-	warning("STUB: c_tell %d", d1.u.i);
+	// swap out current stage
+	Datum window = g_lingo->pop();
+	g_lingo->push(g_director->getCurrentStage());
+	if (window.type != OBJECT || window.u.obj->getObjType() != kWindowObj) {
+		warning("c_tell(): wrong argument type: %s", window.type2str());
+		return;
+	}
+	g_director->setCurrentStage(static_cast<Stage *>(window.u.obj));
+
 }
 
 void LC::c_telldone() {
-	warning("STUB: c_telldone");
+	Datum returnWindow = g_lingo->pop();
+	if (returnWindow.type != OBJECT || returnWindow.u.obj->getObjType() != kWindowObj) {
+		warning("c_tell(): wrong return window type: %s", returnWindow.type2str());
+		return;
+	}
+	g_director->setCurrentStage(static_cast<Stage *>(returnWindow.u.obj));
 }
 
 
diff --git a/engines/director/lingo/lingo-code.h b/engines/director/lingo/lingo-code.h
index 25184373d5..69f6c925d9 100644
--- a/engines/director/lingo/lingo-code.h
+++ b/engines/director/lingo/lingo-code.h
@@ -150,7 +150,6 @@ namespace LC {
 	void cb_objectfieldassign();
 	void cb_objectfieldpush();
 	void cb_objectpush();
-	void cb_tellcall();
 	void cb_theassign();
 	void cb_theassign2();
 	void cb_thepush();




More information about the Scummvm-git-logs mailing list