[Scummvm-git-logs] scummvm master -> 9c6d95e04199d73fb76cc0be4c32f5aa548c83e1

moralrecordings code at moral.net.au
Sun Sep 19 06:23:04 UTC 2021


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

Summary:
7c145266b6 DIRECTOR: Case-scrub paths used by AudioFileDecoder::getAudioStream
9c6d95e041 DIRECTOR: LINGO: Make m_perform inject the current object into the stack


Commit: 7c145266b6112844625aea2d4028e525e22c4952
    https://github.com/scummvm/scummvm/commit/7c145266b6112844625aea2d4028e525e22c4952
Author: Scott Percival (code at moral.net.au)
Date: 2021-09-19T10:45:53+08:00

Commit Message:
DIRECTOR: Case-scrub paths used by AudioFileDecoder::getAudioStream

Fixes the music on the Intro Menu screen of Total Distortion.

Changed paths:
    engines/director/sound.cpp


diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index 519487c93a..41e06bfd1c 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -36,6 +36,7 @@
 #include "director/movie.h"
 #include "director/castmember.h"
 #include "director/sound.h"
+#include "director/util.h"
 #include "director/window.h"
 
 namespace Director {
@@ -772,7 +773,7 @@ Audio::AudioStream *AudioFileDecoder::getAudioStream(bool looping, bool forPuppe
 		return nullptr;
 
 	Common::File *file = new Common::File();
-	if (!file->open(Common::Path(_path, g_director->_dirSeparator))) {
+	if (!file->open(Common::Path(pathMakeRelative(_path), g_director->_dirSeparator))) {
 		warning("Failed to open %s", _path.c_str());
 		return nullptr;
 	}


Commit: 9c6d95e04199d73fb76cc0be4c32f5aa548c83e1
    https://github.com/scummvm/scummvm/commit/9c6d95e04199d73fb76cc0be4c32f5aa548c83e1
Author: Scott Percival (code at moral.net.au)
Date: 2021-09-19T14:17:36+08:00

Commit Message:
DIRECTOR: LINGO: Make m_perform inject the current object into the stack

Fixes the dialogue trees in Total Distortion.

Changed paths:
    engines/director/lingo/lingo-code.cpp
    engines/director/lingo/lingo-object.cpp


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 8d73f21592..657ce115db 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1456,7 +1456,7 @@ void LC::call(const Common::String &name, int nargs, bool allowRetVal) {
 			objName.type = VARREF;
 			Datum obj = g_lingo->varFetch(objName, true);
 			if (obj.type == OBJECT && (obj.u.obj->getObjType() & (kFactoryObj | kXObj))) {
-				debugC(3, kDebugLingoExec, "Method called on object: <%s>", obj.asString(true).c_str());
+				debugC(3, kDebugLingoExec, "Factory/XObject method called on object: <%s>", obj.asString(true).c_str());
 				AbstractObject *target = obj.u.obj;
 				if (firstArg.u.s->equalsIgnoreCase("mNew")) {
 					target = target->clone();
@@ -1475,7 +1475,7 @@ void LC::call(const Common::String &name, int nargs, bool allowRetVal) {
 
 		// Script/Xtra method call
 		if (firstArg.type == OBJECT && !(firstArg.u.obj->getObjType() & (kFactoryObj | kXObj))) {
-			debugC(3, kDebugLingoExec, "Method called on object: <%s>", firstArg.asString(true).c_str());
+			debugC(3, kDebugLingoExec, "Script/Xtra method called on object: <%s>", firstArg.asString(true).c_str());
 			AbstractObject *target = firstArg.u.obj;
 			if (name.equalsIgnoreCase("birth") || name.equalsIgnoreCase("new")) {
 				target = target->clone();
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index a3ac76939f..916bb2c7b7 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -381,10 +381,12 @@ void LM::m_put(int nargs) {
 void LM::m_perform(int nargs) {
 	// Lingo doesn't seem to bother cloning the object when
 	// mNew is called with mPerform
-	AbstractObject *me = g_lingo->_currentMe.u.obj;
+	Datum d(g_lingo->_currentMe);
+	AbstractObject *me = d.u.obj;
 	Datum methodName = g_lingo->_stack.remove_at(g_lingo->_stack.size() - nargs); // Take method name out of stack
-	nargs -= 1;
 	Symbol funcSym = me->getMethod(*methodName.u.s);
+	// Object methods expect the first argument to be the object
+	g_lingo->_stack.insert_at(g_lingo->_stack.size() - nargs + 1, d);
 	LC::call(funcSym, nargs, true);
 }
 




More information about the Scummvm-git-logs mailing list