[Scummvm-git-logs] scummvm master -> 1f6672f71366c534717592e6467172556c0a87db

mgerhardy noreply at scummvm.org
Wed Aug 9 13:42:43 UTC 2023


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:
42265aacc7 TWINE: stop music if another music is about to start
1f6672f713 TWINE: fixed sound event from the other side of the map


Commit: 42265aacc76459ba5112bc88858caa93c6c1b7e4
    https://github.com/scummvm/scummvm/commit/42265aacc76459ba5112bc88858caa93c6c1b7e4
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2023-08-09T01:28:56+02:00

Commit Message:
TWINE: stop music if another music is about to start

Changed paths:
    engines/twine/audio/music.cpp


diff --git a/engines/twine/audio/music.cpp b/engines/twine/audio/music.cpp
index 48bc44cf21d..02857fccfde 100644
--- a/engines/twine/audio/music.cpp
+++ b/engines/twine/audio/music.cpp
@@ -232,10 +232,8 @@ bool Music::playMidiMusic(int32 midiIdx, int32 loop) {
 	stopMusic();
 	currentMusic = midiIdx;
 
-	if (midiPtr) {
-		musicFadeOut();
-		stopMidiMusic();
-	}
+	musicFadeOut();
+	stopMidiMusic();
 
 	if (_engine->isDotEmuEnhanced() || _engine->isLba1Classic()) {
 		const Common::String &trackName = Common::String::format("lba1-%02i", midiIdx + 1);
@@ -269,7 +267,7 @@ bool Music::playMidiMusic(int32 midiIdx, int32 loop) {
 }
 
 void Music::stopMidiMusic() {
-	if (_engine->isDotEmuEnhanced()) {
+	if (_engine->isDotEmuEnhanced() || _engine->isLba1Classic()) {
 		_engine->_system->getMixer()->stopHandle(_midiHandle);
 	}
 


Commit: 1f6672f71366c534717592e6467172556c0a87db
    https://github.com/scummvm/scummvm/commit/1f6672f71366c534717592e6467172556c0a87db
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2023-08-09T01:46:13+02:00

Commit Message:
TWINE: fixed sound event from the other side of the map

see https://bugs.scummvm.org/ticket/13197

Changed paths:
    engines/twine/audio/sound.cpp


diff --git a/engines/twine/audio/sound.cpp b/engines/twine/audio/sound.cpp
index ce030444d76..6a43f8e1f88 100644
--- a/engines/twine/audio/sound.cpp
+++ b/engines/twine/audio/sound.cpp
@@ -55,7 +55,10 @@ void Sound::setSamplePosition(int32 channelIdx, int32 x, int32 y, int32 z) {
 	const int32 camZ = _engine->_grid->_newCamera.z * SIZE_BRICK_XZ;
 	int32 distance = getDistance3D(camX, camY, camZ, x, y, z);
 	distance = _engine->_collision->boundRuleThree(0, distance, 10000, 255);
-	const byte targetVolume = CLIP<byte>(255 - distance, 0, 255);
+	byte targetVolume = 0;
+	if (distance < 255) {
+		targetVolume = 255 - distance;
+	}
 	_engine->_system->getMixer()->setChannelVolume(samplesPlaying[channelIdx], targetVolume);
 }
 
@@ -104,6 +107,8 @@ void Sound::playSample(int32 index, int32 repeat, int32 x, int32 y, int32 z, int
 		setSamplePosition(channelIdx, x, y, z);
 		// save the actor index for the channel so we can check the position
 		samplesPlayingActors[channelIdx] = actorIdx;
+	} else {
+		samplesPlayingActors[channelIdx] = -1;
 	}
 
 	uint8 *sampPtr = _engine->_resources->_samplesTable[index];




More information about the Scummvm-git-logs mailing list