aboutsummaryrefslogtreecommitdiff
path: root/kyra/sound.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2006-01-12 13:16:42 +0000
committerJohannes Schickel2006-01-12 13:16:42 +0000
commit2416254e494d93b52009548f940f7ca28bc4db6d (patch)
treea817a40a50d3a8d1e8657958db5fe7f22c300057 /kyra/sound.cpp
parentb3826575393d324f703e733a99468b97ccc0456c (diff)
downloadscummvm-rg350-2416254e494d93b52009548f940f7ca28bc4db6d.tar.gz
scummvm-rg350-2416254e494d93b52009548f940f7ca28bc4db6d.tar.bz2
scummvm-rg350-2416254e494d93b52009548f940f7ca28bc4db6d.zip
Implemented 'ingame' sound handling, and named the unknown opcodes from the cd version
and 'implemented' them. svn-id: r19988
Diffstat (limited to 'kyra/sound.cpp')
-rw-r--r--kyra/sound.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/kyra/sound.cpp b/kyra/sound.cpp
index 2b3f449114..07895d3fb5 100644
--- a/kyra/sound.cpp
+++ b/kyra/sound.cpp
@@ -110,7 +110,8 @@ void MusicPlayer::send(uint32 b) {
_virChannel[channel] = channel + 16;
if (!_channel[_virChannel[channel]])
_channel[_virChannel[channel]] = _driver->allocateChannel();
- _channel[_virChannel[channel]]->volume(_channelVolume[channel] * _volume / 255);
+ if (_channel[_virChannel[channel]])
+ _channel[_virChannel[channel]]->volume(_channelVolume[channel] * _volume / 255);
}
return;
}
@@ -132,7 +133,8 @@ void MusicPlayer::send(uint32 b) {
if (!_channel[_virChannel[channel]]) {
_channel[_virChannel[channel]] = (channel == 9) ? _driver->getPercussionChannel() : _driver->allocateChannel();
- _channel[_virChannel[channel]]->volume(_channelVolume[channel] * _volume / 255);
+ if (_channel[_virChannel[channel]])
+ _channel[_virChannel[channel]]->volume(_channelVolume[channel] * _volume / 255);
}
if (_channel[_virChannel[channel]])
_channel[_virChannel[channel]]->send(b);
@@ -259,6 +261,8 @@ void MusicPlayer::onTimer(void *refCon) {
music->setVolume(255);
music->_fadeStartTime = 0;
music->_fadeMusicOut = false;
+ music->_isLooping = false;
+ music->_isPlaying = false;
}
if (music->_isPlaying) {