Fix for bug #899881 (Sounds played when sound turned off)

svn-id: r12975
This commit is contained in:
Joost Peters 2004-02-21 20:20:35 +00:00
parent 1d7eafe675
commit 0301ccc8a8
3 changed files with 8 additions and 4 deletions

View File

@ -343,7 +343,8 @@ void Graphics::sortBobs() {
if (pbs->animating) {
pbs->animOneStep();
if (pbs->frameNum > 500) { // SFX frame
_vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
if (_vm->sound()->sfxOn())
_vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
pbs->frameNum -= 500;
}
}
@ -1112,7 +1113,8 @@ void BamScene::playSfx() {
// this problem since their playSfx() function returns immediately
// if a sound is already being played.
if (_lastSoundIndex == 0 || _index - _lastSoundIndex >= SFX_SKIP) {
_vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
if (_vm->sound()->sfxOn())
_vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
_lastSoundIndex = _index;
}
}

View File

@ -1723,7 +1723,8 @@ void Logic::asmMakeLightningHitPlane() {
lightningBob->y = 0;
// 23/2/95 - Play lightning SFX
_vm->sound()->playSfx(currentRoomSfx(), false);
if (_vm->sound()->sfxOn())
_vm->sound()->playSfx(currentRoomSfx(), false);
_vm->bankMan()->unpack(18, lightningBob->frameNum, 15);
_vm->bankMan()->unpack(4, planeBob ->frameNum, 15);

View File

@ -773,7 +773,8 @@ void Talk::stringAnimation(const SpeechParameters *parameters, int startFrame, i
if (frame > 500) {
frame -= 500;
_vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
if (_vm->sound()->sfxOn())
_vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
}
if (torso) {