[Scummvm-cvs-logs] scummvm master -> db77b9e4a7f8491d45b47b539af2077fb15e9376

digitall digitall at scummvm.org
Sat Jun 2 23:35:31 CEST 2012


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:
db77b9e4a7 DREAMWEB: Modify sound code to prevent missing sound effects.


Commit: db77b9e4a7f8491d45b47b539af2077fb15e9376
    https://github.com/scummvm/scummvm/commit/db77b9e4a7f8491d45b47b539af2077fb15e9376
Author: D G Turner (digitall at scummvm.org)
Date: 2012-06-02T14:28:34-07:00

Commit Message:
DREAMWEB: Modify sound code to prevent missing sound effects.

This should fix bug #3528164 "DREAMWEB: missing sound
effects/music cues during main title" by preventing repeated calls
of SFX id 12 being lost if the next call is made before the sound
handler has cleared the previous one.

Changed paths:
    engines/dreamweb/sound.cpp
    engines/dreamweb/sound.h



diff --git a/engines/dreamweb/sound.cpp b/engines/dreamweb/sound.cpp
index 4b636d4..76c734e 100644
--- a/engines/dreamweb/sound.cpp
+++ b/engines/dreamweb/sound.cpp
@@ -41,6 +41,7 @@ DreamWebSound::DreamWebSound(DreamWebEngine *vm) : _vm(vm) {
 	_currentSample = 0xff;
 	_channel0Playing = 0;
 	_channel0Repeat = 0;
+	_channel0NewSound = false;
 	_channel1Playing = 255;
 
 	_volume = 0;
@@ -80,6 +81,12 @@ void DreamWebSound::volumeAdjust() {
 
 void DreamWebSound::playChannel0(uint8 index, uint8 repeat) {
 	debug(1, "playChannel0(index:%d, repeat:%d)", index, repeat);
+
+	if (index == _channel0Playing) {
+		warning("playChannel0(index: %d) already playing! Forcing restart...", index);
+		_channel0NewSound = true;
+	}
+
 	_channel0Playing = index;
 	_channel0Repeat = repeat;
 }
@@ -230,8 +237,9 @@ void DreamWebSound::soundHandler() {
 		ch1 = 0;
 	uint8 ch0loop = _channel0Repeat;
 
-	if (_channel0 != ch0) {
+	if (_channel0 != ch0 || _channel0NewSound) {
 		_channel0 = ch0;
+		_channel0NewSound = false;
 		if (ch0) {
 			playSound(0, ch0, ch0loop);
 		}
diff --git a/engines/dreamweb/sound.h b/engines/dreamweb/sound.h
index 62def15..a38dbf3 100644
--- a/engines/dreamweb/sound.h
+++ b/engines/dreamweb/sound.h
@@ -73,6 +73,7 @@ private:
 	uint8 _currentSample;
 	uint8 _channel0Playing;
 	uint8 _channel0Repeat;
+	bool _channel0NewSound;
 	uint8 _channel1Playing;
 
 	uint8 _volume;






More information about the Scummvm-git-logs mailing list