aboutsummaryrefslogtreecommitdiff
path: root/sword2/sound.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-01-03 11:24:39 +0000
committerTorbjörn Andersson2004-01-03 11:24:39 +0000
commitbb8ff0cd904c89cf70c4419e068f5b0621799006 (patch)
tree289939f0447ed8af5ae9c17acd6058377b94be99 /sword2/sound.cpp
parente73363bd095005e9b849a50f97cd1a9ff04e5ba1 (diff)
downloadscummvm-rg350-bb8ff0cd904c89cf70c4419e068f5b0621799006.tar.gz
scummvm-rg350-bb8ff0cd904c89cf70c4419e068f5b0621799006.tar.bz2
scummvm-rg350-bb8ff0cd904c89cf70c4419e068f5b0621799006.zip
Made the music code more like the one in BS1, i.e. the fade time is longer
and it now fades both up and down. Plenty of cleanups, simplifications and just moving code around to group it in what I hope is a more logical fashion. Fixed a long-standing bug where spot effects would eventually use up all available sound effect handles. (I may have introduced this when I removed the expiration of sound effects from FxServer().) svn-id: r12108
Diffstat (limited to 'sword2/sound.cpp')
-rw-r--r--sword2/sound.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/sword2/sound.cpp b/sword2/sound.cpp
index 22061969d6..cf93f153f1 100644
--- a/sword2/sound.cpp
+++ b/sword2/sound.cpp
@@ -67,8 +67,10 @@ void Sword2Engine::processFxQueue(void) {
break;
case FX_SPOT2:
// Once the Fx has finished remove it from the queue.
- if (_sound->isFxOpen(i + 1))
+ if (!_sound->isFxPlaying(i + 1)) {
_fxQueue[i].resource = 0;
+ _sound->closeFx(i + 1);
+ }
break;
}
}
@@ -178,6 +180,7 @@ int32 Logic::fnPlayFx(int32 *params) {
break;
default:
strcpy(type, "INVALID");
+ break;
}
debug(0, "SFX (sample=\"%s\", vol=%d, pan=%d, delay=%d, type=%s)", _vm->fetchObjectName(params[0]), params[3], params[4], params[2], type);
@@ -244,7 +247,7 @@ int32 Logic::fnPlayFx(int32 *params) {
}
if (_vm->_fxQueue[j].type == FX_LOOP) {
- // play now, rather than in Process_fx_queue where it was
+ // play now, rather than in processFxQueue where it was
// getting played again & again!
_vm->triggerFx(j);
}