aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorMax Horn2004-06-27 22:14:35 +0000
committerMax Horn2004-06-27 22:14:35 +0000
commitb8ad54b3af1de97bf986e7e4d4da97f02ece3273 (patch)
tree59bb3fbadaa8857a75010692593bef3a866d49cb /simon
parenta461c7550e2260601a63cd113a31254f2fd3ef50 (diff)
downloadscummvm-rg350-b8ad54b3af1de97bf986e7e4d4da97f02ece3273.tar.gz
scummvm-rg350-b8ad54b3af1de97bf986e7e4d4da97f02ece3273.tar.bz2
scummvm-rg350-b8ad54b3af1de97bf986e7e4d4da97f02ece3273.zip
Reversed param order of File::open() -- this allowed me to get rid of a few more getGameDataPath() calls
svn-id: r14090
Diffstat (limited to 'simon')
-rw-r--r--simon/items.cpp4
-rw-r--r--simon/res.cpp12
-rw-r--r--simon/simon.cpp24
-rw-r--r--simon/sound.cpp38
-rw-r--r--simon/sound.h7
5 files changed, 42 insertions, 43 deletions
diff --git a/simon/items.cpp b/simon/items.cpp
index d945f6ba76..5e67881576 100644
--- a/simon/items.cpp
+++ b/simon/items.cpp
@@ -1025,9 +1025,9 @@ int SimonEngine::runScript() {
if (_game == GAME_SIMON1CD32) {
char buf[10];
sprintf(buf, "%d%s", _sound_file_id, "Effects");
- _sound->readSfxFile(buf, _gameDataPath);
+ _sound->readSfxFile(buf);
sprintf(buf, "%d%s", _sound_file_id, "simon");
- _sound->readVoiceFile(buf, _gameDataPath);
+ _sound->readVoiceFile(buf);
}
}
diff --git a/simon/res.cpp b/simon/res.cpp
index 036bb50d1e..e32c267ee6 100644
--- a/simon/res.cpp
+++ b/simon/res.cpp
@@ -102,13 +102,13 @@ void SimonEngine::loadGamePcFile(const char *filename) {
int i, file_size;
/* read main gamepc file */
- in.open(filename, _gameDataPath);
+ in.open(filename);
if (in.isOpen() == false) {
char *filename2;
filename2 = (char *)malloc(strlen(filename) + 2);
strcpy(filename2, filename);
strcat(filename2, ".");
- in.open(filename2, _gameDataPath);
+ in.open(filename2);
free(filename2);
if (in.isOpen() == false)
error("Can't open gamepc file '%s' or '%s.'", gss->gamepc_filename, gss->gamepc_filename);
@@ -128,9 +128,9 @@ void SimonEngine::loadGamePcFile(const char *filename) {
in.close();
/* Read list of TABLE resources */
- in.open("TBLLIST", _gameDataPath);
+ in.open("TBLLIST");
if (in.isOpen() == false) {
- in.open("TBLLIST.", _gameDataPath);
+ in.open("TBLLIST.");
if (in.isOpen() == false)
error("Can't open table resources file 'TBLLIST' or 'TBLLIST.'");
}
@@ -150,9 +150,9 @@ void SimonEngine::loadGamePcFile(const char *filename) {
/* Read list of TEXT resources */
if (_game == GAME_SIMON1ACORN)
- in.open("STRIPPED", _gameDataPath);
+ in.open("STRIPPED");
else
- in.open("STRIPPED.TXT", _gameDataPath);
+ in.open("STRIPPED.TXT");
if (in.isOpen() == false)
error("Can't open text resources file 'STRIPPED.TXT'");
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 1ef3aa8c7e..624f601aba 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -1196,7 +1196,7 @@ void SimonEngine::loadTablesIntoMem(uint subr_id) {
if (_game == GAME_SIMON1WIN) {
memcpy(filename, "SFXXXX", 6);
- _sound->readSfxFile(filename, _gameDataPath);
+ _sound->readSfxFile(filename);
} else if (_game & GF_SIMON2) {
_sound->loadSfxTable(_game_file, _game_offsets_ptr[atoi(filename + 6) - 1 + SOUND_INDEX_BASE]);
}
@@ -1226,7 +1226,7 @@ void SimonEngine::playSting(uint a) {
uint16 mus_offset;
sprintf(filename, "STINGS%i.MUS", _sound_file_id);
- mus_file.open(filename, _gameDataPath);
+ mus_file.open(filename);
if (!mus_file.isOpen()) {
warning("Can't load sound effect from '%s'", filename);
return;
@@ -1290,7 +1290,7 @@ File *SimonEngine::openTablesFile_gme(const char *filename) {
uint SimonEngine::loadTextFile_simon1(const char *filename, byte *dst) {
File fo;
- fo.open(filename, _gameDataPath);
+ fo.open(filename);
uint32 size;
if (fo.isOpen() == false)
@@ -1307,7 +1307,7 @@ uint SimonEngine::loadTextFile_simon1(const char *filename, byte *dst) {
File *SimonEngine::openTablesFile_simon1(const char *filename) {
File *fo = new File();
- fo->open(filename, _gameDataPath);
+ fo->open(filename);
if (fo->isOpen() == false)
error("openTablesFile: Can't open '%s'", filename);
return fo;
@@ -1799,11 +1799,11 @@ uint SimonEngine::item_get_icon_number(Item *item) {
void SimonEngine::loadIconFile() {
File in;
if (_game & GF_ACORN)
- in.open("ICONDATA", _gameDataPath);
+ in.open("ICONDATA");
else if (_game & GF_AMIGA)
- in.open("icon.pkd", _gameDataPath);
+ in.open("icon.pkd");
else
- in.open("ICON.DAT", _gameDataPath);
+ in.open("ICON.DAT");
uint size;
if (in.isOpen() == false)
@@ -4273,7 +4273,7 @@ void SimonEngine::read_vga_from_datfile_1(uint vga_id) {
sprintf(buf, "0%d.VGA", vga_id);
}
- in.open(buf, _gameDataPath);
+ in.open(buf);
if (in.isOpen() == false)
error("read_vga_from_datfile_1: can't open %s", buf);
size = in.size();
@@ -4318,7 +4318,7 @@ byte *SimonEngine::read_vga_from_datfile_2(uint id) {
sprintf(buf, "%.3d%d.VGA", id >> 1, (id & 1) + 1);
}
- in.open(buf, _gameDataPath);
+ in.open(buf);
if (in.isOpen() == false)
error("read_vga_from_datfile_2: can't open %s", buf);
size = in.size();
@@ -4358,7 +4358,7 @@ void SimonEngine::resfile_read(void *dst, uint32 offs, uint32 size) {
void SimonEngine::openGameFile() {
if (!(_game & GF_OLD_BUNDLE)) {
_game_file = new File();
- _game_file->open(gss->gme_filename, _gameDataPath);
+ _game_file->open(gss->gme_filename);
if (_game_file->isOpen() == false)
error("Can't open game file '%s'", gss->gme_filename);
@@ -4577,7 +4577,7 @@ void SimonEngine::go() {
setup_vga_file_buf_pointers();
- _sound = new Sound(_game, gss, _gameDataPath, _mixer);
+ _sound = new Sound(_game, gss, _mixer);
_debugger = new Debugger(this);
if (ConfMan.hasKey("sfx_mute") && ConfMan.getBool("sfx_mute") == 1) {
@@ -5046,7 +5046,7 @@ void SimonEngine::loadMusic (uint music) {
char buf[15];
File f;
sprintf(buf, "MOD%d.MUS", music);
- f.open(buf, _gameDataPath);
+ f.open(buf);
if (f.isOpen() == false) {
warning("Can't load music from '%s'", buf);
return;
diff --git a/simon/sound.cpp b/simon/sound.cpp
index 1d4dd92c3b..50aca0fe1f 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -265,8 +265,8 @@ void FlacSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags)
}
#endif
-Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::String &gameDataPath, SoundMixer *mixer)
- : _game(game), _gameDataPath(gameDataPath), _mixer(mixer) {
+Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer)
+ : _game(game), _mixer(mixer) {
_voice = 0;
_effects = 0;
@@ -285,7 +285,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
#ifdef USE_FLAC
if (!_voice && gss->flac_filename && gss->flac_filename[0]) {
- file->open(gss->flac_filename, gameDataPath);
+ file->open(gss->flac_filename);
if (file->isOpen()) {
_voice_file = true;
_voice = new FlacSound(_mixer, file);
@@ -294,7 +294,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
#endif
#ifdef USE_MAD
if (!_voice && gss->mp3_filename && gss->mp3_filename[0]) {
- file->open(gss->mp3_filename, gameDataPath);
+ file->open(gss->mp3_filename);
if (file->isOpen()) {
_voice_file = true;
_voice = new MP3Sound(_mixer, file);
@@ -303,7 +303,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
#endif
#ifdef USE_VORBIS
if (!_voice && gss->vorbis_filename && gss->vorbis_filename[0]) {
- file->open(gss->vorbis_filename, gameDataPath);
+ file->open(gss->vorbis_filename);
if (file->isOpen()) {
_voice_file = true;
_voice = new VorbisSound(_mixer, file);
@@ -313,7 +313,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
if (!_voice) {
// for simon2 mac/amiga, only read index file
if (_game == GAME_SIMON2MAC) {
- file->open("voices.idx", gameDataPath);
+ file->open("voices.idx");
if (file->isOpen() == false) {
warning("Can't open voice index file 'voices.idx'");
} else {
@@ -332,7 +332,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
delete file;
} else if (_game & GF_WIN) {
s = gss->wav_filename;
- file->open(s, gameDataPath);
+ file->open(s);
if (file->isOpen() == false) {
warning("Can't open voice file %s", s);
delete file;
@@ -345,7 +345,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
return;
} else if (_game & GF_TALKIE) {
s = gss->voc_filename;
- file->open(s, gameDataPath);
+ file->open(s);
if (file->isOpen() == false) {
warning("Can't open voice file %s", s);
delete file;
@@ -360,7 +360,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
file = new File();
#ifdef USE_MAD
if (!_effects && gss->mp3_effects_filename && gss->mp3_effects_filename[0]) {
- file->open(gss->mp3_effects_filename, gameDataPath);
+ file->open(gss->mp3_effects_filename);
if (file->isOpen()) {
_effects = new MP3Sound(_mixer, file);
}
@@ -368,7 +368,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
#endif
#ifdef USE_VORBIS
if (!_effects && gss->vorbis_effects_filename && gss->vorbis_effects_filename[0]) {
- file->open(gss->vorbis_effects_filename, gameDataPath);
+ file->open(gss->vorbis_effects_filename);
if (file->isOpen()) {
_effects = new VorbisSound(_mixer, file);
}
@@ -376,7 +376,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
#endif
#ifdef USE_FLAC
if (!_effects && gss->flac_effects_filename && gss->flac_effects_filename[0]) {
- file->open(gss->flac_effects_filename, gameDataPath);
+ file->open(gss->flac_effects_filename);
if (file->isOpen()) {
_effects = new FlacSound(_mixer, file);
}
@@ -384,7 +384,7 @@ Sound::Sound(const byte game, const GameSpecificSettings *gss, const Common::Str
#endif
if (!_effects) {
s = gss->voc_effects_filename;
- file->open(s, gameDataPath);
+ file->open(s);
if (file->isOpen() == false) {
warning("Can't open effects file %s", s);
} else {
@@ -402,18 +402,18 @@ Sound::~Sound() {
free(_offsets);
}
-void Sound::readSfxFile(const char *filename, const Common::String &gameDataPath) {
+void Sound::readSfxFile(const char *filename) {
stopAll();
File *file = new File();
- file->open(filename, gameDataPath);
+ file->open(filename);
if (file->isOpen() == false) {
char *filename2;
filename2 = (char *)malloc(strlen(filename) + 2);
strcpy(filename2, filename);
strcat(filename2, ".");
- file->open(filename2, gameDataPath);
+ file->open(filename2);
free(filename2);
if (file->isOpen() == false) {
if (atoi(filename + 6) != 1 && atoi(filename + 6) != 30)
@@ -438,18 +438,18 @@ void Sound::loadSfxTable(File *gameFile, uint32 base) {
_effects = new VocSound(_mixer, gameFile, base);
}
-void Sound::readVoiceFile(const char *filename, const Common::String &gameDataPath) {
+void Sound::readVoiceFile(const char *filename) {
stopAll();
File *file = new File();
- file->open(filename, gameDataPath);
+ file->open(filename);
if (file->isOpen() == false) {
char *filename2;
filename2 = (char *)malloc(strlen(filename) + 2);
strcpy(filename2, filename);
strcat(filename2, ".");
- file->open(filename2, gameDataPath);
+ file->open(filename2);
free(filename2);
if (file->isOpen() == false) {
warning("readVoiceFile: Can't load voice file %s", filename);
@@ -470,7 +470,7 @@ void Sound::playVoice(uint sound) {
_last_voice_file = _filenums[sound];
sprintf(filename, "voices%d.dat", _filenums[sound]);
File *file = new File();
- file->open(filename, _gameDataPath);
+ file->open(filename);
if (file->isOpen() == false) {
warning("playVoice: Can't load voice file %s", filename);
return;
diff --git a/simon/sound.h b/simon/sound.h
index 79ec0fa9e5..5ca7b2a028 100644
--- a/simon/sound.h
+++ b/simon/sound.h
@@ -31,7 +31,6 @@ class BaseSound;
class Sound {
private:
byte _game;
- const Common::String _gameDataPath;
SoundMixer *_mixer;
@@ -53,12 +52,12 @@ public:
bool _voice_file;
uint _ambient_playing;
- Sound(const byte game, const GameSpecificSettings *gss, const Common::String &gameDataPath, SoundMixer *mixer);
+ Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer);
~Sound();
- void readSfxFile(const char *filename, const Common::String &gameDataPath);
+ void readSfxFile(const char *filename);
void loadSfxTable(File *gameFile, uint32 base);
- void readVoiceFile(const char *filename, const Common::String &gameDataPath);
+ void readVoiceFile(const char *filename);
void playVoice(uint sound);
void playEffects(uint sound);