aboutsummaryrefslogtreecommitdiff
path: root/simon/sound.cpp
diff options
context:
space:
mode:
authorTravis Howell2003-10-23 04:49:04 +0000
committerTravis Howell2003-10-23 04:49:04 +0000
commit3ccd6704bdc4a6fad19d2fb68a75c089dc4f60ca (patch)
treed755aa2d3fa46bda3332b6eb6035c55ed4c29424 /simon/sound.cpp
parent016c90911ed73b8f4498d6192172c1882062e18c (diff)
downloadscummvm-rg350-3ccd6704bdc4a6fad19d2fb68a75c089dc4f60ca.tar.gz
scummvm-rg350-3ccd6704bdc4a6fad19d2fb68a75c089dc4f60ca.tar.bz2
scummvm-rg350-3ccd6704bdc4a6fad19d2fb68a75c089dc4f60ca.zip
Don't attempt to play sound in simon2mac if file doesn't exist.
Add fixme for simon2mac, freeing voice at this point which causes crashes. svn-id: r10943
Diffstat (limited to 'simon/sound.cpp')
-rw-r--r--simon/sound.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp
index b56d5a428f..04391b61d3 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -355,7 +355,7 @@ void SimonSound::readSfxFile(const char *filename, const Common::String &gameDat
free(filename2);
if (file->isOpen() == false) {
if (atoi(filename + 6) != 1 && atoi(filename + 6) != 30)
- warning("readSfxFile: Can't load sfx file %s", filename);
+ warning("readSfxFile: Can't load sfx file %s", filename);
return;
}
}
@@ -390,7 +390,6 @@ void SimonSound::readVoiceFile(const char *filename, const Common::String &gameD
file->open(filename2, gameDataPath);
free(filename2);
if (file->isOpen() == false) {
- if (atoi(filename + 6) != 1 && atoi(filename + 6) != 30)
warning("readVoiceFile: Can't load voice file %s", filename);
return;
}
@@ -409,11 +408,13 @@ void SimonSound::playVoice(uint sound) {
File *file = new File();
file->open(filename, _gameDataPath);
if (file->isOpen() == false) {
- warning("Can't open voice file %s", filename);
- } else {
- delete _voice;
- _voice = new WavSound(_mixer, file, _offsets);
- }
+ warning("playVoice: Can't load voice file %s", filename);
+ return;
+ }
+ // FIXME freeing voice at this point causes frequent game crashes
+ // Maybe related to sound effects and speech using same sound format ?
+ // delete _voice;
+ _voice = new WavSound(_mixer, file, _offsets);
}
if (!_voice)