From 4f9dc057312c858d8d576ea181bdbd064996b1ec Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 7 Sep 2008 21:59:25 +0000 Subject: Add a priority param to OSystem::addSysArchivesToSearchSet (still in search for a better name ;) svn-id: r34432 --- backends/platform/sdl/sdl.cpp | 6 +++--- backends/platform/sdl/sdl.h | 2 +- common/system.h | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 3423cd43c5..9a6f294a55 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -275,7 +275,7 @@ FilesystemFactory *OSystem_SDL::getFilesystemFactory() { return _fsFactory; } -void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s) { +void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, uint priority) { #ifdef DATA_PATH // Add the global DATA_PATH to the directory search list @@ -283,7 +283,7 @@ void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s) { Common::FilesystemNode dataNode(DATA_PATH); if (dataNode.exists() && dataNode.isDirectory()) { Common::ArchivePtr dataArchive(new Common::FSDirectory(dataNode, 4)); - s.add(DATA_PATH, dataArchive); + s.add(DATA_PATH, dataArchive, priority); } #endif @@ -297,7 +297,7 @@ void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s) { // Success: Add it to the search path Common::String bundlePath((const char *)buf); Common::ArchivePtr bundleArchive(new Common::FSDirectory(bundlePath)); - s.add("__OSX_BUNDLE__", bundleArchive); + s.add("__OSX_BUNDLE__", bundleArchive, priority); } CFRelease(fileUrl); } diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index f13cfafdaa..1cc0acbc29 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -209,7 +209,7 @@ public: virtual Common::SaveFileManager *getSavefileManager(); virtual FilesystemFactory *getFilesystemFactory(); - virtual void addSysArchivesToSearchSet(Common::SearchSet &s); + virtual void addSysArchivesToSearchSet(Common::SearchSet &s, uint priority = 0); virtual Common::SeekableReadStream *openConfigFileForReading(); virtual Common::WriteStream *openConfigFileForWriting(); diff --git a/common/system.h b/common/system.h index b0e3e8ce14..cb9dbedad7 100644 --- a/common/system.h +++ b/common/system.h @@ -914,9 +914,10 @@ public: * * @todo Come up with a better name. This one sucks. * - * @todo Allow specifying a priority with which the new dirs are added? + * @param s the SearchSet to which the system specific dirs, if any, are added + * @param priority the priority with which those dirs are added */ - virtual void addSysArchivesToSearchSet(Common::SearchSet &s) {} + virtual void addSysArchivesToSearchSet(Common::SearchSet &s, uint priority = 0) {} /** * Open the default config file for reading, by returning a suitable -- cgit v1.2.3