aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2010-01-22 23:58:24 +0000
committerMax Horn2010-01-22 23:58:24 +0000
commite270da88a68cc30ad6804eddb2d891fa80da47af (patch)
tree5221fda05138f53210efca0494f366937c4b6c3f /engines
parente754d8e1d3ae09cc5ab0915be2d656a927ac41a9 (diff)
downloadscummvm-rg350-e270da88a68cc30ad6804eddb2d891fa80da47af.tar.gz
scummvm-rg350-e270da88a68cc30ad6804eddb2d891fa80da47af.tar.bz2
scummvm-rg350-e270da88a68cc30ad6804eddb2d891fa80da47af.zip
AGOS: cleanup
svn-id: r47451
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/script_s1.cpp2
-rw-r--r--engines/agos/sound.cpp11
-rw-r--r--engines/agos/sound.h6
-rw-r--r--engines/agos/subroutine.cpp2
4 files changed, 13 insertions, 8 deletions
diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp
index 797a938bc6..0db612a8c6 100644
--- a/engines/agos/script_s1.cpp
+++ b/engines/agos/script_s1.cpp
@@ -558,7 +558,7 @@ void AGOSEngine_Simon1::os1_unloadZone() {
void AGOSEngine_Simon1::os1_loadStrings() {
// 185: load sound files
_soundFileId = getVarOrWord();
- if (getPlatform() == Common::kPlatformAmiga && getFeatures() & GF_TALKIE) {
+ if (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_TALKIE)) {
char buf[10];
sprintf(buf, "%d%s", _soundFileId, "Effects");
_sound->readSfxFile(buf);
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp
index 6154a71618..37362a7986 100644
--- a/engines/agos/sound.cpp
+++ b/engines/agos/sound.cpp
@@ -574,7 +574,8 @@ void Sound::loadSfxFile(const GameSpecificSettings *gss) {
}
}
-void Sound::readSfxFile(const char *filename) {
+// This method is only used by Simon1 Amiga Talkie & Windows
+void Sound::readSfxFile(const Common::String &filename) {
if (_hasEffectsFile)
return;
@@ -584,7 +585,7 @@ void Sound::readSfxFile(const char *filename) {
file->open(filename);
if (file->isOpen() == false) {
- error("readSfxFile: Can't load sfx file %s", filename);
+ error("readSfxFile: Can't load sfx file %s", filename.c_str());
}
delete _effects;
@@ -594,6 +595,7 @@ void Sound::readSfxFile(const char *filename) {
_effects = new WavSound(_mixer, file);
}
+// This method is only used by Simon2
void Sound::loadSfxTable(File *gameFile, uint32 base) {
stopAll();
@@ -606,14 +608,15 @@ void Sound::loadSfxTable(File *gameFile, uint32 base) {
_effects = new VocSound(_mixer, gameFile, base);
}
-void Sound::readVoiceFile(const char *filename) {
+// This method is only used by Simon1 Amiga Talkie
+void Sound::readVoiceFile(const Common::String &filename) {
_mixer->stopHandle(_voiceHandle);
File *file = new File();
file->open(filename);
if (file->isOpen() == false)
- error("readVoiceFile: Can't load voice file %s", filename);
+ error("readVoiceFile: Can't load voice file %s", filename.c_str());
delete _voice;
_voice = new RawSound(_mixer, file, 0, SOUND_BIG_ENDIAN);
diff --git a/engines/agos/sound.h b/engines/agos/sound.h
index 9812a0571c..10ff14d5ac 100644
--- a/engines/agos/sound.h
+++ b/engines/agos/sound.h
@@ -78,12 +78,14 @@ public:
TYPE_SFX5 = 1 << 2
};
+protected:
void loadVoiceFile(const GameSpecificSettings *gss);
void loadSfxFile(const GameSpecificSettings *gss);
- void readSfxFile(const char *filename);
+public:
+ void readSfxFile(const Common::String &filename);
void loadSfxTable(Common::File *gameFile, uint32 base);
- void readVoiceFile(const char *filename);
+ void readVoiceFile(const Common::String &filename);
void playVoice(uint sound);
void playEffects(uint sound);
diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp
index 880e2d0f55..8dccded958 100644
--- a/engines/agos/subroutine.cpp
+++ b/engines/agos/subroutine.cpp
@@ -383,7 +383,7 @@ bool AGOSEngine_Waxworks::loadTablesIntoMem(uint16 subrId) {
filename.setChar('X', 4);
filename.setChar('X', 5);
if (atoi(filename.c_str() + 6) != 1 && atoi(filename.c_str() + 6) != 30)
- _sound->readSfxFile(filename.c_str());
+ _sound->readSfxFile(filename);
}
alignTableMem();