aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoost Peters2004-02-21 20:50:56 +0000
committerJoost Peters2004-02-21 20:50:56 +0000
commit6e50033d07011d8fcae941c5c10530081d522db0 (patch)
treedc54f1db5504e24bd9794b41eb12009d854faeb8
parent0301ccc8a88283d02b65749fd21f90e71582f14d (diff)
downloadscummvm-rg350-6e50033d07011d8fcae941c5c10530081d522db0.tar.gz
scummvm-rg350-6e50033d07011d8fcae941c5c10530081d522db0.tar.bz2
scummvm-rg350-6e50033d07011d8fcae941c5c10530081d522db0.zip
I am an idiot.
Better fix for bug #899881 (Sounds played when sound turned off) - I forgot I added the isSpeech flag a while back. :) svn-id: r12976
-rw-r--r--queen/graphics.cpp6
-rw-r--r--queen/logic.cpp3
-rw-r--r--queen/sound.cpp6
-rw-r--r--queen/talk.cpp3
4 files changed, 10 insertions, 8 deletions
diff --git a/queen/graphics.cpp b/queen/graphics.cpp
index dc7301a8f7..e845b4e6c8 100644
--- a/queen/graphics.cpp
+++ b/queen/graphics.cpp
@@ -343,8 +343,7 @@ void Graphics::sortBobs() {
if (pbs->animating) {
pbs->animOneStep();
if (pbs->frameNum > 500) { // SFX frame
- if (_vm->sound()->sfxOn())
- _vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
+ _vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
pbs->frameNum -= 500;
}
}
@@ -1113,8 +1112,7 @@ 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) {
- if (_vm->sound()->sfxOn())
- _vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
+ _vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
_lastSoundIndex = _index;
}
}
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 4f6edb14b3..8181abe32e 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -1723,8 +1723,7 @@ void Logic::asmMakeLightningHitPlane() {
lightningBob->y = 0;
// 23/2/95 - Play lightning SFX
- if (_vm->sound()->sfxOn())
- _vm->sound()->playSfx(currentRoomSfx(), false);
+ _vm->sound()->playSfx(currentRoomSfx(), false);
_vm->bankMan()->unpack(18, lightningBob->frameNum, 15);
_vm->bankMan()->unpack(4, planeBob ->frameNum, 15);
diff --git a/queen/sound.cpp b/queen/sound.cpp
index ccfcf23a5d..c403d32b1c 100644
--- a/queen/sound.cpp
+++ b/queen/sound.cpp
@@ -77,6 +77,9 @@ void Sound::waitFinished(bool isSpeech) {
}
void Sound::playSfx(uint16 sfx, bool isSpeech) {
+ if (isSpeech && !speechOn()) return;
+ else if (!sfxOn()) return;
+
if (sfx != 0) {
char name[13];
strcpy(name, _sfxName[sfx - 1]);
@@ -87,6 +90,9 @@ void Sound::playSfx(uint16 sfx, bool isSpeech) {
}
void Sound::playSfx(const char *base, bool isSpeech) {
+ if (isSpeech && !speechOn()) return;
+ else if (!sfxOn()) return;
+
char name[13];
strcpy(name, base);
// alter filename to add zeros and append ".SB"
diff --git a/queen/talk.cpp b/queen/talk.cpp
index c0d7fd02e8..1d0223f19b 100644
--- a/queen/talk.cpp
+++ b/queen/talk.cpp
@@ -773,8 +773,7 @@ void Talk::stringAnimation(const SpeechParameters *parameters, int startFrame, i
if (frame > 500) {
frame -= 500;
- if (_vm->sound()->sfxOn())
- _vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
+ _vm->sound()->playSfx(_vm->logic()->currentRoomSfx(), false);
}
if (torso) {