aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2005-05-08 05:23:31 +0000
committerTravis Howell2005-05-08 05:23:31 +0000
commit169c85a19b619e85a02c9009f241a30e8c9e0f8f (patch)
tree85e033274971d9746aaba01f9defa6088e6b52be /simon
parent0bcd57e87fc6437b789916edc204bf40e07c67a5 (diff)
downloadscummvm-rg350-169c85a19b619e85a02c9009f241a30e8c9e0f8f.tar.gz
scummvm-rg350-169c85a19b619e85a02c9009f241a30e8c9e0f8f.tar.bz2
scummvm-rg350-169c85a19b619e85a02c9009f241a30e8c9e0f8f.zip
Auto detect effect file type in Simon the Sorcerer 1.
svn-id: r17951
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp4
-rw-r--r--simon/sound.cpp8
-rw-r--r--simon/sound.h1
3 files changed, 11 insertions, 2 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index c7cfa41734..1c568f2142 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -64,7 +64,7 @@ static const SimonGameSettings simon_settings[] = {
{"simon1amiga", "Simon the Sorcerer 1 (Amiga)", GAME_SIMON1AMIGA, "gameamiga"},
{"simon2dos", "Simon the Sorcerer 2 (DOS)", GAME_SIMON2DOS, "GAME32"},
{"simon1talkie", "Simon the Sorcerer 1 Talkie", GAME_SIMON1TALKIE, "GAMEPC"},
- {"simon1win", "Simon the Sorcerer 1 Talkie (Windows)", GAME_SIMON1WIN, 0},
+ {"simon1win", "Simon the Sorcerer 1 Talkie (Windows)", GAME_SIMON1TALKIE, 0},
{"simon2talkie", "Simon the Sorcerer 2 Talkie", GAME_SIMON2TALKIE, "GSPTR30"},
{"simon2win", "Simon the Sorcerer 2 Talkie (Windows)", GAME_SIMON2WIN, 0},
{"simon2mac", "Simon the Sorcerer 2 Talkie (Amiga or Mac)", GAME_SIMON2WIN, 0},
@@ -1343,7 +1343,7 @@ void SimonEngine::loadTablesIntoMem(uint subr_id) {
if (_game & GF_SIMON2) {
_sound->loadSfxTable(_gameFile, _gameOffsetsPtr[atoi(filename + 6) - 1 + SOUND_INDEX_BASE]);
- } else if (_game & GF_WIN) {
+ } else {
memcpy(filename, "SFXXXX", 6);
_sound->readSfxFile(filename);
}
diff --git a/simon/sound.cpp b/simon/sound.cpp
index cc9fd268c0..5c02510700 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -241,6 +241,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer
_last_voice_file = 0;
_offsets = 0;
+ _effects_file = false;
_voice_file = false;
_ambient_playing = 0;
@@ -317,6 +318,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer
if (!_effects && gss->mp3_effects_filename && gss->mp3_effects_filename[0]) {
file->open(gss->mp3_effects_filename);
if (file->isOpen()) {
+ _effects_file = true;
_effects = new MP3Sound(_mixer, file);
}
}
@@ -325,6 +327,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer
if (!_effects && gss->vorbis_effects_filename && gss->vorbis_effects_filename[0]) {
file->open(gss->vorbis_effects_filename);
if (file->isOpen()) {
+ _effects_file = true;
_effects = new VorbisSound(_mixer, file);
}
}
@@ -333,6 +336,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer
if (!_effects && gss->flac_effects_filename && gss->flac_effects_filename[0]) {
file->open(gss->flac_effects_filename);
if (file->isOpen()) {
+ _effects_file = true;
_effects = new FlacSound(_mixer, file);
}
}
@@ -340,6 +344,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer
if (!_effects && gss->voc_effects_filename && gss->voc_effects_filename[0]) {
file->open(gss->voc_effects_filename);
if (file->isOpen()) {
+ _effects_file = true;
_effects = new VocSound(_mixer, file);
}
}
@@ -355,6 +360,9 @@ Sound::~Sound() {
}
void Sound::readSfxFile(const char *filename) {
+ if (_effects_file)
+ return;
+
stopAll();
File *file = new File();
diff --git a/simon/sound.h b/simon/sound.h
index 4e92bff100..69b5040f2d 100644
--- a/simon/sound.h
+++ b/simon/sound.h
@@ -49,6 +49,7 @@ public:
SoundHandle _effects_handle;
SoundHandle _ambient_handle;
+ bool _effects_file;
bool _voice_file;
uint _ambient_playing;