diff options
Diffstat (limited to 'engines/adl/adl_v2.cpp')
-rw-r--r-- | engines/adl/adl_v2.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp index 23294391ab..dfc2df6ef4 100644 --- a/engines/adl/adl_v2.cpp +++ b/engines/adl/adl_v2.cpp @@ -26,6 +26,7 @@ #include "adl/adl_v2.h" #include "adl/display.h" #include "adl/graphics.h" +#include "adl/detection.h" namespace Adl { @@ -38,6 +39,7 @@ AdlEngine_v2::AdlEngine_v2(OSystem *syst, const AdlGameDescription *gd) : AdlEngine(syst, gd), _maxLines(4), _disk(nullptr), + _currentVolume(0), _itemRemoved(false), _roomOnScreen(0), _picOnScreen(0), @@ -45,6 +47,26 @@ AdlEngine_v2::AdlEngine_v2(OSystem *syst, const AdlGameDescription *gd) : _random = new Common::RandomSource("adl"); } +Common::String AdlEngine_v2::getDiskImageName(byte volume) const { + const ADGameFileDescription *ag; + + for (ag = _gameDescription->desc.filesDescriptions; ag->fileName; ag++) + if (ag->fileType == volume) + return ag->fileName; + + error("Disk volume %d not found", volume); +} + +void AdlEngine_v2::insertDisk(byte volume) { + delete _disk; + _disk = new DiskImage(); + + if (!_disk->open(getDiskImageName(volume))) + error("Failed to open disk volume %d", volume); + + _currentVolume = volume; +} + typedef Common::Functor1Mem<ScriptEnv &, int, AdlEngine_v2> OpcodeV2; #define SetOpcodeTable(x) table = &x; #define Opcode(x) table->push_back(new OpcodeV2(this, &AdlEngine_v2::x)) |