[Scummvm-cvs-logs] CVS: scummvm/scumm/imuse_digi dimuse_bndmgr.cpp,1.20,1.21 dimuse_bndmgr.h,1.9,1.10 dimuse_sndmgr.cpp,1.49,1.50

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


Update of /cvsroot/scummvm/scummvm/scumm/imuse_digi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17109

Modified Files:
	dimuse_bndmgr.cpp dimuse_bndmgr.h dimuse_sndmgr.cpp 
Log Message:
Thanks to File::setDefaultDirectory(), in most cases it is *not* necessary to pass getGameDataPath() on to File::open()

Index: dimuse_bndmgr.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_bndmgr.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- dimuse_bndmgr.cpp	19 Jun 2004 15:17:50 -0000	1.20
+++ dimuse_bndmgr.cpp	27 Jun 2004 22:03:38 -0000	1.21
@@ -40,19 +40,19 @@
 	}
 }
 
-BundleDirCache::AudioTable *BundleDirCache::getTable(const char *filename, const char *directory) {
-	int slot = matchFile(filename, directory);
+BundleDirCache::AudioTable *BundleDirCache::getTable(const char *filename) {
+	int slot = matchFile(filename);
 	assert(slot != -1);
 	return _budleDirCache[slot].bundleTable;
 }
 
-int32 BundleDirCache::getNumFiles(const char *filename, const char *directory) {
-	int slot = matchFile(filename, directory);
+int32 BundleDirCache::getNumFiles(const char *filename) {
+	int slot = matchFile(filename);
 	assert(slot != -1);
 	return _budleDirCache[slot].numFiles;
 }
 
-int BundleDirCache::matchFile(const char *filename, const char *directory) {
+int BundleDirCache::matchFile(const char *filename) {
 	int32 tag, offset;
 	bool found = false;
 	int freeSlot = -1;
@@ -71,7 +71,7 @@
 	if (!found) {
 		File file;
 
-		if (file.open(filename, directory) == false) {
+		if (file.open(filename) == false) {
 			warning("BundleDirCache::matchFile() Can't open bundle file: %s", filename);
 			return false;
 		}
@@ -126,18 +126,18 @@
 	closeFile();
 }
 
-bool BundleMgr::openFile(const char *filename, const char *directory) {
+bool BundleMgr::openFile(const char *filename) {
 	if (_file.isOpen())
 		return true;
 
-	if (_file.open(filename, directory) == false) {
+	if (_file.open(filename) == false) {
 		warning("BundleMgr::openFile() Can't open bundle file: %s", filename);
 		return false;
 	}
 
-	_numFiles = _cache->getNumFiles(filename, directory);
+	_numFiles = _cache->getNumFiles(filename);
 	assert(_numFiles);
-	_bundleTable = _cache->getTable(filename, directory);
+	_bundleTable = _cache->getTable(filename);
 	assert(_bundleTable);
 	_compTableLoaded = false;
 	_outputSize = 0;

Index: dimuse_bndmgr.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_bndmgr.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- dimuse_bndmgr.h	19 Jun 2004 14:54:13 -0000	1.9
+++ dimuse_bndmgr.h	27 Jun 2004 22:03:38 -0000	1.10
@@ -40,14 +40,14 @@
 		int32 numFiles;
 	} _budleDirCache[4];
 	
-	int matchFile(const char *filename, const char *directory);
+	int matchFile(const char *filename);
 
 public:
 	BundleDirCache();
 	~BundleDirCache();
 
-	AudioTable *getTable(const char *filename, const char *directory);
-	int32 getNumFiles(const char *filename, const char *directory);
+	AudioTable *getTable(const char *filename);
+	int32 getNumFiles(const char *filename);
 };
 
 class BundleMgr {
@@ -78,7 +78,7 @@
 	BundleMgr(BundleDirCache *_cache);
 	~BundleMgr();
 
-	bool openFile(const char *filename, const char *directory);
+	bool openFile(const char *filename);
 	void closeFile();
 	int32 decompressSampleByName(const char *name, int32 offset, int32 size, byte **comp_final, bool header_outside);
 	int32 decompressSampleByIndex(int32 index, int32 offset, int32 size, byte **comp_final, int header_size, bool header_outside);

Index: dimuse_sndmgr.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_sndmgr.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- dimuse_sndmgr.cpp	20 Jun 2004 13:19:22 -0000	1.49
+++ dimuse_sndmgr.cpp	27 Jun 2004 22:03:38 -0000	1.50
@@ -224,7 +224,7 @@
 	sound->bundle = new BundleMgr(_cacheBundleDir);
 	if (_vm->_gameId == GID_CMI) {
 		if (_vm->_features & GF_DEMO) {
-			result = sound->bundle->openFile("music.bun", _vm->getGameDataPath());
+			result = sound->bundle->openFile("music.bun");
 		} else {
 			char musicfile[20];
 			if (disk == -1)
@@ -238,14 +238,14 @@
 //				sound->bundle->closeFile();
 //			}
 
-			result = sound->bundle->openFile(musicfile, _vm->getGameDataPath());
+			result = sound->bundle->openFile(musicfile);
 
 			if (result == false)
-				result = sound->bundle->openFile("music.bun", _vm->getGameDataPath());
+				result = sound->bundle->openFile("music.bun");
 			_disk = (byte)_vm->VAR(_vm->VAR_CURRENTDISK);
 		}
 	} else if (_vm->_gameId == GID_DIG)
-		result = sound->bundle->openFile("digmusic.bun", _vm->getGameDataPath());
+		result = sound->bundle->openFile("digmusic.bun");
 	else
 		error("ImuseDigiSndMgr::openMusicBundle() Don't know which bundle file to load");
 
@@ -258,7 +258,7 @@
 	sound->bundle = new BundleMgr(_cacheBundleDir);
 	if (_vm->_gameId == GID_CMI) {
 		if (_vm->_features & GF_DEMO) {
-			result = sound->bundle->openFile("voice.bun", _vm->getGameDataPath());
+			result = sound->bundle->openFile("voice.bun");
 		} else {
 			char voxfile[20];
 			if (disk == -1)
@@ -272,14 +272,14 @@
 //				sound->bundle->closeFile();
 //			}
 
-			result = sound->bundle->openFile(voxfile, _vm->getGameDataPath());
+			result = sound->bundle->openFile(voxfile);
 
 			if (result == false)
-				result = sound->bundle->openFile("voice.bun", _vm->getGameDataPath());
+				result = sound->bundle->openFile("voice.bun");
 			_disk = (byte)_vm->VAR(_vm->VAR_CURRENTDISK);
 		}
 	} else if (_vm->_gameId == GID_DIG)
-		result = sound->bundle->openFile("digvoice.bun", _vm->getGameDataPath());
+		result = sound->bundle->openFile("digvoice.bun");
 	else
 		error("ImuseDigiSndMgr::openVoiceBundle() Don't know which bundle file to load");
 





More information about the Scummvm-git-logs mailing list