[Scummvm-cvs-logs] SF.net SVN: scummvm:[53928] scummvm/trunk/engines/toon

sylvaintv at users.sourceforge.net sylvaintv at users.sourceforge.net
Sat Oct 30 00:00:32 CEST 2010


Revision: 53928
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53928&view=rev
Author:   sylvaintv
Date:     2010-10-29 22:00:31 +0000 (Fri, 29 Oct 2010)

Log Message:
-----------
TOON: Stops all Sfx/voice when exiting a room

Caused crashs when exiting when a sfx or voice was still playing
Bug found by Thomas

Modified Paths:
--------------
    scummvm/trunk/engines/toon/audio.cpp
    scummvm/trunk/engines/toon/audio.h
    scummvm/trunk/engines/toon/toon.cpp

Modified: scummvm/trunk/engines/toon/audio.cpp
===================================================================
--- scummvm/trunk/engines/toon/audio.cpp	2010-10-29 19:00:37 UTC (rev 53927)
+++ scummvm/trunk/engines/toon/audio.cpp	2010-10-29 22:00:31 UTC (rev 53928)
@@ -191,6 +191,14 @@
 	return -1;
 }
 
+void AudioManager::stopAllSfxs() {
+	for (int32 i = 3; i < 16; i++) {
+		if (_channels[i] && _channels[i]->isPlaying()) {
+			_channels[i]->stop(false);
+		}
+	}
+}
+
 void AudioManager::stopCurrentVoice() {
 	debugC(1, kDebugAudio, "stopCurrentVoice()");
 

Modified: scummvm/trunk/engines/toon/audio.h
===================================================================
--- scummvm/trunk/engines/toon/audio.h	2010-10-29 19:00:37 UTC (rev 53927)
+++ scummvm/trunk/engines/toon/audio.h	2010-10-29 22:00:31 UTC (rev 53928)
@@ -132,6 +132,7 @@
 	void playVoice(int32 id, bool genericVoice);
 	int32 playSFX(int32 id, int volume, bool genericSFX);
 	void stopCurrentVoice();
+	void stopAllSfxs(); 
 	void setMusicVolume(int32 volume);
 	void stopMusic();
 	void muteVoice(bool mute);

Modified: scummvm/trunk/engines/toon/toon.cpp
===================================================================
--- scummvm/trunk/engines/toon/toon.cpp	2010-10-29 19:00:37 UTC (rev 53927)
+++ scummvm/trunk/engines/toon/toon.cpp	2010-10-29 22:00:31 UTC (rev 53928)
@@ -1572,11 +1572,17 @@
 		_gameState->_mouseState = -1;
 	}
 
+	_audioManager->killAllAmbientSFX();
+	_audioManager->stopAllSfxs();
+	_audioManager->stopCurrentVoice();
+	_currentTextLine = 0;
+	_currentTextLineId = -1;
+	_currentTextLineCharacterId = 0;
+
 	char temp[256];
 	strcpy(temp, createRoomFilename(Common::String::printf("%s.pak", _gameState->_locations[_gameState->_currentScene]._name).c_str()).c_str());
 	resources()->closePackage(temp);
 
-	_audioManager->killAllAmbientSFX();
 
 	_drew->stopWalk();
 	_flux->stopWalk();


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