diff options
author | Walter van Niftrik | 2018-02-03 11:36:35 +0100 |
---|---|---|
committer | Walter van Niftrik | 2018-02-03 23:36:18 +0100 |
commit | a0631840f9d39d648813ca2e63fd3b41c898e2ed (patch) | |
tree | 2d54e424bcfabca4a0c2a1807f1cb9d55adc1047 | |
parent | 7e0cac25de91ff2d1f14cd852e0a2b8dba64d173 (diff) | |
download | scummvm-rg350-a0631840f9d39d648813ca2e63fd3b41c898e2ed.tar.gz scummvm-rg350-a0631840f9d39d648813ca2e63fd3b41c898e2ed.tar.bz2 scummvm-rg350-a0631840f9d39d648813ca2e63fd3b41c898e2ed.zip |
ADL: Remove hardcoded disk image filename from hires1
-rw-r--r-- | engines/adl/adl.cpp | 4 | ||||
-rw-r--r-- | engines/adl/adl.h | 1 | ||||
-rw-r--r-- | engines/adl/adl_v2.cpp | 4 | ||||
-rw-r--r-- | engines/adl/adl_v2.h | 1 | ||||
-rw-r--r-- | engines/adl/hires1.cpp | 12 |
5 files changed, 12 insertions, 10 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 36549827a5..fba97db98b 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -74,6 +74,10 @@ AdlEngine::AdlEngine(OSystem *syst, const AdlGameDescription *gd) : DebugMan.addDebugChannel(kDebugChannelScript, "Script", "Trace script execution"); } +Common::String AdlEngine::getDiskImageName(byte volume) const { + return Adl::getDiskImageName(_gameDescription->desc, volume); +} + bool AdlEngine::pollEvent(Common::Event &event) const { _console->onFrame(); diff --git a/engines/adl/adl.h b/engines/adl/adl.h index 7076ab2394..44f16edab6 100644 --- a/engines/adl/adl.h +++ b/engines/adl/adl.h @@ -241,6 +241,7 @@ protected: Common::Error saveGameState(int slot, const Common::String &desc); bool canSaveGameStateCurrently(); + Common::String getDiskImageName(byte volume) const; virtual void gameLoop(); virtual void loadState(Common::ReadStream &stream); virtual void saveState(Common::WriteStream &stream); diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp index b142839850..4eb12c339f 100644 --- a/engines/adl/adl_v2.cpp +++ b/engines/adl/adl_v2.cpp @@ -47,10 +47,6 @@ AdlEngine_v2::AdlEngine_v2(OSystem *syst, const AdlGameDescription *gd) : _random = new Common::RandomSource("adl"); } -Common::String AdlEngine_v2::getDiskImageName(byte volume) const { - return Adl::getDiskImageName(_gameDescription->desc, volume); -} - void AdlEngine_v2::insertDisk(byte volume) { delete _disk; _disk = new DiskImage(); diff --git a/engines/adl/adl_v2.h b/engines/adl/adl_v2.h index fc22c31701..1b4ee4ddd2 100644 --- a/engines/adl/adl_v2.h +++ b/engines/adl/adl_v2.h @@ -54,7 +54,6 @@ protected: // Engine bool canSaveGameStateCurrently(); - Common::String getDiskImageName(byte volume) const; void insertDisk(byte volume); virtual DataBlockPtr readDataBlockPtr(Common::ReadStream &f) const; virtual void adjustDataBlockPtr(byte &track, byte §or, byte &offset, byte &size) const { } diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp index 41436ac2af..2dcbd16e51 100644 --- a/engines/adl/hires1.cpp +++ b/engines/adl/hires1.cpp @@ -222,12 +222,14 @@ void HiRes1Engine::runIntro() { } void HiRes1Engine::init() { - if (Common::File::exists("MYSTHOUS.DSK")) { - _files = new Files_DOS33(); - if (!static_cast<Files_DOS33 *>(_files)->open("MYSTHOUS.DSK")) - error("Failed to open MYSTHOUS.DSK"); - } else + if (Common::File::exists("ADVENTURE")) { _files = new Files_Plain(); + } else { + Files_DOS33 *files = new Files_DOS33(); + if (!files->open(getDiskImageName(0))) + error("Failed to open '%s'", getDiskImageName(0).c_str()); + _files = files; + } _graphics = new GraphicsMan(*_display); |