diff options
-rw-r--r-- | simon/simon.cpp | 45 | ||||
-rw-r--r-- | simon/sound.cpp | 33 |
2 files changed, 37 insertions, 41 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp index 2ed3a513f5..c7cfa41734 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -366,28 +366,33 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) } _language = Common::parseLanguage(ConfMan.get("language")); - if ((_game & GF_SIMON2) && (_game & GF_TALKIE)) { - gss = PTR(simon2win_settings); - - // Add default file directories - File::addDefaultDirectory(_gameDataPath + "voices/"); - File::addDefaultDirectory(_gameDataPath + "VOICES/"); - } else if (_game & GF_SIMON2) - gss = PTR(simon2dos_settings); - else if (_game & GF_ACORN) { - gss = PTR(simon1acorn_settings); + if (_game & GF_SIMON2) { + if (_game & GF_TALKIE) { + gss = PTR(simon2win_settings); - // Add default file directories - File::addDefaultDirectory(_gameDataPath + "execute/"); - File::addDefaultDirectory(_gameDataPath + "EXECUTE/"); - } else if (_game & GF_AMIGA) { - gss = PTR(simon1amiga_settings); - } else if (_game & GF_DEMO) - gss = PTR(simon1demo_settings); - else - gss = PTR(simon1_settings); + // Add default file directories + File::addDefaultDirectory(_gameDataPath + "voices/"); + File::addDefaultDirectory(_gameDataPath + "VOICES/"); + } else { + gss = PTR(simon2dos_settings); + } + } else if (_game & GF_SIMON1) { + if (_game & GF_ACORN) { + gss = PTR(simon1acorn_settings); + + // Add default file directories + File::addDefaultDirectory(_gameDataPath + "execute/"); + File::addDefaultDirectory(_gameDataPath + "EXECUTE/"); + } else if (_game & GF_AMIGA) { + gss = PTR(simon1amiga_settings); + } else if (_game & GF_DEMO) { + gss = PTR(simon1demo_settings); + } else { + gss = PTR(simon1_settings); + } + } - if (!(_game & GF_SIMON2) && (_game & GF_TALKIE)) { + if ((_game & GF_SIMON1) && (_game & GF_TALKIE)) { // Add default file directories switch (_language) { case 20: diff --git a/simon/sound.cpp b/simon/sound.cpp index 1dfbb78b31..dae44ea654 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -292,31 +292,22 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer for (int i = 1; i <= end / 6; i++) { _filenums[i] = file->readUint16BE(); _offsets[i] = file->readUint32BE(); + } + _voice_file = true; } - _voice_file = true; - delete file; } if (!_voice && gss->wav_filename && gss->wav_filename[0]) { - s = gss->wav_filename; - file->open(s); - if (file->isOpen() == false) { - debug(0, "Can't open voice file %s", s); - delete file; - } else { - _voice_file = true; - _voice = new WavSound(_mixer, file); - } + file->open(gss->wav_filename); + if (file->isOpen()) { + _voice_file = true; + _voice = new WavSound(_mixer, file); + } } if (!_voice && gss->voc_filename && gss->voc_filename[0]) { - s = gss->voc_filename; - file->open(s); - if (file->isOpen() == false) { - debug(0, "Can't open voice file %s", s); - delete file; - } else { - _voice_file = true; - _voice = new VocSound(_mixer, file); - } + file->open(gss->voc_filename); + if (file->isOpen()) { + _voice_file = true; + _voice = new VocSound(_mixer, file); } } @@ -350,7 +341,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer s = gss->voc_effects_filename; file->open(s); if (file->isOpen() == false) { - warning("Can't open effects file %s", s); + debug(0, "Can't open effects file %s", s); } else { _effects = new VocSound(_mixer, file); } |