aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2008-06-02 06:51:59 +0000
committerEugene Sandulenko2008-06-02 06:51:59 +0000
commitcd6d528c422de5906aac1882cc1924dda903f759 (patch)
tree0407b27bca6e406f9f61e3e5fa3f9dbf5fe7e553
parentaaf8b5810c4e4c689e31cef8c03dd5fc1b3ad519 (diff)
downloadscummvm-rg350-cd6d528c422de5906aac1882cc1924dda903f759.tar.gz
scummvm-rg350-cd6d528c422de5906aac1882cc1924dda903f759.tar.bz2
scummvm-rg350-cd6d528c422de5906aac1882cc1924dda903f759.zip
Better implementation of packet games loading
svn-id: r32490
-rw-r--r--engines/drascula/detection.cpp11
-rw-r--r--engines/drascula/drascula.cpp10
-rw-r--r--engines/drascula/drascula.h2
3 files changed, 14 insertions, 9 deletions
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 358a2bc1c3..a79a1f5674 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -47,6 +47,17 @@ Common::Language DrasculaEngine::getLanguage() const {
return _gameDescription->desc.language;
}
+void DrasculaEngine::loadArchives() {
+ const Common::ADGameFileDescription *ag;
+
+ if (getFeatures() & GF_PACKED) {
+ for (ag = _gameDescription->desc.filesDescriptions; ag->fileName; ag++)
+ _arj.registerArchive(ag->fileName);
+ }
+
+ _arj.enableFallback(true);
+}
+
}
static const PlainGameDescriptor drasculaGames[] = {
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 513581eb13..29bc4aad8b 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -58,8 +58,6 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
- const GameSettings *g;
-
_rnd = new Common::RandomSource();
syst->getEventManager()->registerRandomSource(*_rnd, "drascula");
@@ -102,13 +100,7 @@ int DrasculaEngine::init() {
_lang = 0;
}
- _arj.registerArchive("packet.001");
- // Use override files for non-English versions
- if (_lang == 3) // French
- _arj.registerArchive("packet.002");
- else if (_lang == 2) // German
- _arj.registerArchive("packet.003");
- _arj.enableFallback(true);
+ loadArchives();
return 0;
}
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index 4f9a487a6b..e98cad2a6c 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -162,6 +162,8 @@ public:
Common::Language getLanguage() const;
void updateEvents();
+ void loadArchives();
+
Audio::SoundHandle _soundHandle;
void allocMemory();