[Scummvm-git-logs] scummvm master -> 75e5a5e331806e5abdc3707730df5cc1be20813b

ysj1173886760 42030331+ysj1173886760 at users.noreply.github.com
Sun Jul 25 07:04:46 UTC 2021


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:
75e5a5e331 DIRECTOR: amend puppetSound for D4+ version.


Commit: 75e5a5e331806e5abdc3707730df5cc1be20813b
    https://github.com/scummvm/scummvm/commit/75e5a5e331806e5abdc3707730df5cc1be20813b
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-25T15:04:28+08:00

Commit Message:
DIRECTOR: amend puppetSound for D4+ version.

Changed paths:
    engines/director/lingo/lingo-builtins.cpp


diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 051627300c..2d1e8ac6b2 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1803,24 +1803,28 @@ void LB::b_puppetSound(int nargs) {
 	}
 
 	sound->_puppet = true;
-	if (nargs == 1) {
+	if (nargs == 1 || g_director->getVersion() >= 400) {
 		Datum castMember = g_lingo->pop();
 
 		// in D2 manual p206, puppetSound 0 will turn off the puppet status of sound
 		if (castMember.asInt() == 0)
 			sound->_puppet = false;
 
-		sound->playCastMember(castMember.asMemberID(), 1);
+		uint channel = 1;
+		if (nargs == 2)
+			channel = g_lingo->pop().asInt();
+
+		sound->playCastMember(castMember.asMemberID(), channel);
 	} else {
+		// in D2/3/3.1 interactivity manual, 2 args represent the menu and submenu sounds
 		uint submenu = g_lingo->pop().asInt();
 		uint menu = g_lingo->pop().asInt();
 
 		if (score->_sampleSounds.empty())
 			score->loadSampleSounds(menu);
 
-		if (submenu <= score->_sampleSounds.size()) {
+		if (submenu <= score->_sampleSounds.size())
 			sound->playExternalSound(score->_sampleSounds[submenu - 1], 1, submenu);
-		}
 	}
 }
 




More information about the Scummvm-git-logs mailing list