From b7f9e2137bcccf0928c8116333db5a8a6536e94a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 27 Jun 2004 22:03:38 +0000 Subject: Thanks to File::setDefaultDirectory(), in most cases it is *not* necessary to pass getGameDataPath() on to File::open() svn-id: r14088 --- scumm/imuse_digi/dimuse_bndmgr.cpp | 20 ++++++++++---------- scumm/imuse_digi/dimuse_bndmgr.h | 8 ++++---- scumm/imuse_digi/dimuse_sndmgr.cpp | 16 ++++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'scumm/imuse_digi') diff --git a/scumm/imuse_digi/dimuse_bndmgr.cpp b/scumm/imuse_digi/dimuse_bndmgr.cpp index aeaa3efcef..a222eb91a9 100644 --- a/scumm/imuse_digi/dimuse_bndmgr.cpp +++ b/scumm/imuse_digi/dimuse_bndmgr.cpp @@ -40,19 +40,19 @@ BundleDirCache::~BundleDirCache() { } } -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 @@ int BundleDirCache::matchFile(const char *filename, const char *directory) { 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 @@ BundleMgr::~BundleMgr() { 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; diff --git a/scumm/imuse_digi/dimuse_bndmgr.h b/scumm/imuse_digi/dimuse_bndmgr.h index 8c35be3522..071ee1d11c 100644 --- a/scumm/imuse_digi/dimuse_bndmgr.h +++ b/scumm/imuse_digi/dimuse_bndmgr.h @@ -40,14 +40,14 @@ private: 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 @@ public: 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); diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp index 7e5a6b2513..94ebc7e03b 100644 --- a/scumm/imuse_digi/dimuse_sndmgr.cpp +++ b/scumm/imuse_digi/dimuse_sndmgr.cpp @@ -224,7 +224,7 @@ bool ImuseDigiSndMgr::openMusicBundle(soundStruct *sound, int disk) { 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 @@ bool ImuseDigiSndMgr::openMusicBundle(soundStruct *sound, int disk) { // 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 @@ bool ImuseDigiSndMgr::openVoiceBundle(soundStruct *sound, int disk) { 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 @@ bool ImuseDigiSndMgr::openVoiceBundle(soundStruct *sound, int disk) { // 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"); -- cgit v1.2.3