[Scummvm-cvs-logs] CVS: scummvm/sound mixer.cpp,1.57,1.58
James Brown
ender at users.sourceforge.net
Fri Jul 4 07:11:08 CEST 2003
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv29407/sound
Modified Files:
mixer.cpp
Log Message:
Insert preliminary Zak256 sound looping support. It's not perfect, as some Zak256 sounds only loop a part of the sample - which our mixer API doesn't yet support.
Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- mixer.cpp 3 Jul 2003 22:05:22 -0000 1.57
+++ mixer.cpp 4 Jul 2003 14:10:44 -0000 1.58
@@ -229,6 +229,11 @@
}
int SoundMixer::playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, int id) {
+ // Prevent duplicate sounds
+ for (int i = 0; i != NUM_CHANNELS; i++)
+ if (_channels[i] != NULL && _channels[i]->_id == id)
+ return -1;
+
return insertChannel(handle, new ChannelRaw(this, sound, size, rate, flags, id));
}
More information about the Scummvm-git-logs
mailing list