aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2003-07-24 16:54:40 +0000
committerTravis Howell2003-07-24 16:54:40 +0000
commitbe7597a8c9e406f798b0ebcea7c131825366582b (patch)
tree2693308e452aefa120cbb69aa0e22867caa816c6 /simon
parent5f3cd3b584158da5a070204bc8d1fb16c1429e54 (diff)
downloadscummvm-rg350-be7597a8c9e406f798b0ebcea7c131825366582b.tar.gz
scummvm-rg350-be7597a8c9e406f798b0ebcea7c131825366582b.tar.bz2
scummvm-rg350-be7597a8c9e406f798b0ebcea7c131825366582b.zip
Should be right now
svn-id: r9174
Diffstat (limited to 'simon')
-rw-r--r--simon/sound.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp
index 18b84e86a5..0257d66186 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -387,9 +387,7 @@ void SimonSound::readSfxFile(const char *filename, const char *gameDataPath) {
}
}
- if (_effects)
- delete _effects;
-
+ delete _effects;
if (_game == GAME_SIMON1CD32) {
_effects = new VocSound(_mixer, file, 0, SOUND_BIG_ENDIAN);
} else
@@ -425,14 +423,14 @@ void SimonSound::readVoiceFile(const char *filename, const char *gameDataPath) {
}
}
- if (_voice)
- delete _voice;
-
+ delete _voice;
_voice = new RawSound(_mixer, file, 0, SOUND_BIG_ENDIAN);
}
void SimonSound::playVoice(uint sound) {
if (_game == GAME_SIMON2MAC && _filenums) {
+ stopAll();
+
char filename[16];
sprintf(filename, "voices%d.dat", _filenums[sound]);
File *file = new File();
@@ -440,9 +438,7 @@ void SimonSound::playVoice(uint sound) {
if (file->isOpen() == false) {
warning("Can't open voice file %s", filename);
} else {
- if (_voice)
- delete _voice;
-
+ delete _voice;
_voice = new WavSound(_mixer, file, _offsets);
}
}