aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/detection.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2014-01-22 00:30:28 +0100
committerJohannes Schickel2014-01-22 00:30:28 +0100
commit1cee8439e70e26427ac5ff04f559016db99bf66b (patch)
tree68e864eb34ab2ee3d7e5fe4f97074a36543850da /engines/agos/detection.cpp
parente560dca6b1953d7266cad6cc6316fcd9e7303933 (diff)
downloadscummvm-rg350-1cee8439e70e26427ac5ff04f559016db99bf66b.tar.gz
scummvm-rg350-1cee8439e70e26427ac5ff04f559016db99bf66b.tar.bz2
scummvm-rg350-1cee8439e70e26427ac5ff04f559016db99bf66b.zip
AGOS: Get rid of ArchiveMan in favor of global SearchMan.
This in fact slightly changes the priority order of added archives. Formerly, all archives in SearchMan were preferred to the customly added ones in ArchiveMan. All standard paths (i.e. path and extrapath) will be still be searched before the custom ones (which are all priority 0 right now) but system specific paths will be searched after (due to their priority being -1). Since system specific paths shouldn't contain any game data files this should hopefully be harmless. This wasn't tested for games with CAB archives.
Diffstat (limited to 'engines/agos/detection.cpp')
-rw-r--r--engines/agos/detection.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index a5a42a86ad..b6d3c2f020 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -28,6 +28,7 @@
#include "common/savefile.h"
#include "common/system.h"
#include "common/textconsole.h"
+#include "common/installshield_cab.h"
#include "agos/intern.h"
#include "agos/agos.h"
@@ -269,8 +270,12 @@ void AGOSEngine::loadArchives() {
if (getFeatures() & GF_PACKED) {
for (ag = _gameDescription->desc.filesDescriptions; ag->fileName; ag++) {
- if (!_archives.hasArchive(ag->fileName))
- _archives.registerArchive(ag->fileName, ag->fileType);
+ if (!SearchMan.hasArchive(ag->fileName)) {
+ Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember(ag->fileName);
+
+ if (stream)
+ SearchMan.add(ag->fileName, Common::makeInstallShieldArchive(stream, DisposeAfterUse::YES), ag->fileType);
+ }
}
}
}