aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-09-16 22:35:21 +0000
committerTravis Howell2006-09-16 22:35:21 +0000
commitff317afc644ca9d8195436a00a88b1b89ac6ccfb (patch)
tree0b5f1eb052579868c0503d072d6eb57ee87d92e9
parent27d39dabef68480316fcf84e4715887ed529618a (diff)
downloadscummvm-rg350-ff317afc644ca9d8195436a00a88b1b89ac6ccfb.tar.gz
scummvm-rg350-ff317afc644ca9d8195436a00a88b1b89ac6ccfb.tar.bz2
scummvm-rg350-ff317afc644ca9d8195436a00a88b1b89ac6ccfb.zip
Fix bug #1559767 - SIMONWIN: Crashes on start-up
svn-id: r23898
-rw-r--r--engines/simon/sound.cpp3
-rw-r--r--engines/simon/subroutine.cpp9
2 files changed, 5 insertions, 7 deletions
diff --git a/engines/simon/sound.cpp b/engines/simon/sound.cpp
index 80099aae9b..52ad6ccdfc 100644
--- a/engines/simon/sound.cpp
+++ b/engines/simon/sound.cpp
@@ -427,8 +427,7 @@ void Sound::readSfxFile(const char *filename) {
file->open(filename);
if (file->isOpen() == false) {
- if (atoi(filename + 6) != 1 && atoi(filename + 6) != 30)
- error("readSfxFile: Can't load sfx file %s", filename);
+ error("readSfxFile: Can't load sfx file %s", filename);
}
delete _effects;
diff --git a/engines/simon/subroutine.cpp b/engines/simon/subroutine.cpp
index 8a2b731422..3587fa4a0b 100644
--- a/engines/simon/subroutine.cpp
+++ b/engines/simon/subroutine.cpp
@@ -136,13 +136,12 @@ void SimonEngine::loadTablesIntoMem(uint subr_id) {
in = openTablesFile(filename);
readSubroutineBlock(in);
closeTablesFile(in);
- if (getGameType() == GType_FF) {
- // TODO
- } else if (getGameType() == GType_SIMON2) {
+ if (getGameType() == GType_SIMON2) {
_sound->loadSfxTable(_gameFile, _gameOffsetsPtr[atoi(filename + 6) - 1 + _soundIndexBase]);
- } else if (getPlatform() == Common::kPlatformWindows) {
+ } else if (getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformWindows) {
memcpy(filename, "SFXXXX", 6);
- _sound->readSfxFile(filename);
+ if (atoi(filename + 6) != 1 && atoi(filename + 6) != 30)
+ _sound->readSfxFile(filename);
}
alignTableMem();