[Scummvm-cvs-logs] SF.net SVN: scummvm: [33078] scummvm/trunk/engines/queen

cyx at users.sourceforge.net cyx at users.sourceforge.net
Tue Jul 15 22:26:13 CEST 2008


Revision: 33078
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33078&view=rev
Author:   cyx
Date:     2008-07-15 13:26:12 -0700 (Tue, 15 Jul 2008)

Log Message:
-----------
fix bug #1995042: stop previous sfx playback when starting a new sfx (matches original dos code). Also removed the "sound skipping" hack in final bam scene.

Modified Paths:
--------------
    scummvm/trunk/engines/queen/graphics.cpp
    scummvm/trunk/engines/queen/graphics.h
    scummvm/trunk/engines/queen/sound.cpp
    scummvm/trunk/engines/queen/sound.h

Modified: scummvm/trunk/engines/queen/graphics.cpp
===================================================================
--- scummvm/trunk/engines/queen/graphics.cpp	2008-07-15 19:35:40 UTC (rev 33077)
+++ scummvm/trunk/engines/queen/graphics.cpp	2008-07-15 20:26:12 UTC (rev 33078)
@@ -1175,15 +1175,8 @@
 }
 
 void BamScene::playSfx() {
-	// Don't try to play all the sounds. This is only necessary for the
-	// fight bam, in which the number of 'sfx bam frames' is too much
-	// important / too much closer. The original game does not have
-	// this problem since its playSfx() function returns immediately
-	// if a sound is already being played.
-	if (_lastSoundIndex == 0 || _index - _lastSoundIndex >= SFX_SKIP) {
-		_vm->sound()->playSfx(_vm->logic()->currentRoomSfx());
-		_lastSoundIndex = _index;
-	}
+	_vm->sound()->playSfx(_vm->logic()->currentRoomSfx());
+	_lastSoundIndex = _index;
 }
 
 void BamScene::prepareAnimation() {

Modified: scummvm/trunk/engines/queen/graphics.h
===================================================================
--- scummvm/trunk/engines/queen/graphics.h	2008-07-15 19:35:40 UTC (rev 33077)
+++ scummvm/trunk/engines/queen/graphics.h	2008-07-15 20:26:12 UTC (rev 33078)
@@ -248,10 +248,6 @@
 		F_REQ_STOP = 2
 	};
 
-	enum {
-		SFX_SKIP = 8
-	};
-
 	uint16 _flag, _index;
 
 private:

Modified: scummvm/trunk/engines/queen/sound.cpp
===================================================================
--- scummvm/trunk/engines/queen/sound.cpp	2008-07-15 19:35:40 UTC (rev 33077)
+++ scummvm/trunk/engines/queen/sound.cpp	2008-07-15 20:26:12 UTC (rev 33078)
@@ -229,11 +229,6 @@
 	_music->setVolume(vol);
 }
 
-void PCSound::waitFinished(bool isSpeech) {
-	while (_mixer->isSoundHandleActive(isSpeech ? _speechHandle : _sfxHandle))
-		_vm->input()->delay(10);
-}
-
 void PCSound::playSound(const char *base, bool isSpeech) {
 	char name[13];
 	strcpy(name, base);
@@ -243,7 +238,13 @@
 			name[i] = '0';
 	}
 	strcat(name, ".SB");
-	waitFinished(isSpeech);
+	if (isSpeech) {
+		while (_mixer->isSoundHandleActive(_speechHandle)) {
+			_vm->input()->delay(10);
+		}
+	} else {
+		_mixer->stopHandle(_sfxHandle);
+	}
 	uint32 size;
 	Common::File *f = _vm->resource()->findSound(name, &size);
 	if (f) {

Modified: scummvm/trunk/engines/queen/sound.h
===================================================================
--- scummvm/trunk/engines/queen/sound.h	2008-07-15 19:35:40 UTC (rev 33077)
+++ scummvm/trunk/engines/queen/sound.h	2008-07-15 20:26:12 UTC (rev 33078)
@@ -143,7 +143,6 @@
 	void setVolume(int vol);
 
 protected:
-	void waitFinished(bool isSpeech);
 	void playSound(const char *base, bool isSpeech);
 
 	virtual void playSoundData(Common::File *f, uint32 size, Audio::SoundHandle *soundHandle) = 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list