[Scummvm-cvs-logs] SF.net SVN: scummvm:[35193] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Nov 30 16:15:14 CET 2008
Revision: 35193
http://scummvm.svn.sourceforge.net/scummvm/?rev=35193&view=rev
Author: lordhoto
Date: 2008-11-30 15:15:14 +0000 (Sun, 30 Nov 2008)
Log Message:
-----------
Fixed some looping MIDI sound effects.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/scene_hof.cpp
scummvm/trunk/engines/kyra/scene_lok.cpp
scummvm/trunk/engines/kyra/sound.h
scummvm/trunk/engines/kyra/sound_midi.cpp
Modified: scummvm/trunk/engines/kyra/scene_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_hof.cpp 2008-11-30 13:03:43 UTC (rev 35192)
+++ scummvm/trunk/engines/kyra/scene_hof.cpp 2008-11-30 15:15:14 UTC (rev 35193)
@@ -81,6 +81,9 @@
moveCharacter(facing, x, y);
}
+ // TODO: Check how the original handled sfx still playing
+ _sound->stopAllSoundEffects();
+
bool newSoundFile = false;
uint32 waitTime = 0;
if (_sceneList[newScene].sound != _lastMusicCommand) {
Modified: scummvm/trunk/engines/kyra/scene_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lok.cpp 2008-11-30 13:03:43 UTC (rev 35192)
+++ scummvm/trunk/engines/kyra/scene_lok.cpp 2008-11-30 15:15:14 UTC (rev 35193)
@@ -48,6 +48,9 @@
_abortWalkFlag = false;
_abortWalkFlag2 = false;
+ // TODO: Check how the original handled sfx still playing
+ _sound->stopAllSoundEffects();
+
if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
int newSfxFile = -1;
if (_currentCharacter->sceneId == 7 && sceneId == 24)
Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h 2008-11-30 13:03:43 UTC (rev 35192)
+++ scummvm/trunk/engines/kyra/sound.h 2008-11-30 15:15:14 UTC (rev 35193)
@@ -151,6 +151,11 @@
virtual void playSoundEffect(uint8 track) = 0;
/**
+ * Stop playback of all sfx tracks.
+ */
+ virtual void stopAllSoundEffects() {}
+
+ /**
* Checks if the sound driver plays any sound.
*
* @return true if playing, false otherwise
@@ -334,6 +339,7 @@
bool isPlaying();
void playSoundEffect(uint8 track);
+ void stopAllSoundEffects();
void beginFadeOut();
Modified: scummvm/trunk/engines/kyra/sound_midi.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_midi.cpp 2008-11-30 13:03:43 UTC (rev 35192)
+++ scummvm/trunk/engines/kyra/sound_midi.cpp 2008-11-30 15:15:14 UTC (rev 35193)
@@ -639,6 +639,16 @@
}
}
+void SoundMidiPC::stopAllSoundEffects() {
+ Common::StackLock lock(_mutex);
+
+ for (int i = 0; i < 3; ++i) {
+ _output->setSoundSource(i+1);
+ _sfx[i]->stopPlaying();
+ _output->deinitSource(i+1);
+ }
+}
+
void SoundMidiPC::beginFadeOut() {
Common::StackLock lock(_mutex);
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