[Scummvm-cvs-logs] CVS: scummvm/simon res.cpp,1.28,1.29 sound.cpp,1.65,1.66 simon.cpp,1.435,1.436 items.cpp,1.112,1.113 sound.h,1.17,1.18

Max Horn fingolfin at users.sourceforge.net
Sun Jun 27 15:15:16 CEST 2004


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19289/simon

Modified Files:
	res.cpp sound.cpp simon.cpp items.cpp sound.h 
Log Message:
Reversed param order of File::open() -- this allowed me to get rid of a few more getGameDataPath() calls

Index: res.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/res.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- res.cpp	6 Jan 2004 12:45:31 -0000	1.28
+++ res.cpp	27 Jun 2004 22:14:34 -0000	1.29
@@ -102,13 +102,13 @@
 	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 @@
 	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 @@
 
 	/* 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'");
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- sound.cpp	22 Feb 2004 14:11:16 -0000	1.65
+++ sound.cpp	27 Jun 2004 22:14:34 -0000	1.66
@@ -265,8 +265,8 @@
 }
 #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 @@
 
 #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 @@
 #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 @@
 #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 @@
 	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 @@
 			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 @@
 			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 @@
 		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 @@
 #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 @@
 #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 @@
 #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 @@
 	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 @@
 		_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 @@
 			_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;

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.435
retrieving revision 1.436
diff -u -d -r1.435 -r1.436
--- simon.cpp	25 Jun 2004 22:39:20 -0000	1.435
+++ simon.cpp	27 Jun 2004 22:14:34 -0000	1.436
@@ -1196,7 +1196,7 @@
 
 				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 @@
 	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 @@
 
 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 @@
 
 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 @@
 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 @@
 			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 @@
 			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::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 @@
 
 	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 @@
 				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;

Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- items.cpp	14 Mar 2004 17:50:36 -0000	1.112
+++ items.cpp	27 Jun 2004 22:14:35 -0000	1.113
@@ -1025,9 +1025,9 @@
 				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);
 				}
 
 			}

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- sound.h	6 Jan 2004 12:45:31 -0000	1.17
+++ sound.h	27 Jun 2004 22:14:35 -0000	1.18
@@ -31,7 +31,6 @@
 class Sound {
 private:
 	byte _game;
-	const Common::String _gameDataPath;
 
 	SoundMixer *_mixer;
 
@@ -53,12 +52,12 @@
 	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);





More information about the Scummvm-git-logs mailing list