diff options
author | Strangerke | 2016-10-11 07:37:12 +0200 |
---|---|---|
committer | Strangerke | 2016-10-11 21:44:01 +0200 |
commit | 7c138231e034f7434ee3968ca777b515666fb5c1 (patch) | |
tree | eccfe95812379c9c5d0cb1e1e2d967ea1c055e62 /engines/dm | |
parent | 719bc03487ca27e98378f7f48f05ba9312cbd432 (diff) | |
download | scummvm-rg350-7c138231e034f7434ee3968ca777b515666fb5c1.tar.gz scummvm-rg350-7c138231e034f7434ee3968ca777b515666fb5c1.tar.bz2 scummvm-rg350-7c138231e034f7434ee3968ca777b515666fb5c1.zip |
DM: Handle demo dungeon file
Diffstat (limited to 'engines/dm')
-rw-r--r-- | engines/dm/detection.cpp | 2 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 5 | ||||
-rw-r--r-- | engines/dm/dm.h | 4 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 9 |
4 files changed, 17 insertions, 3 deletions
diff --git a/engines/dm/detection.cpp b/engines/dm/detection.cpp index 8361ec300d..e8ec79a176 100644 --- a/engines/dm/detection.cpp +++ b/engines/dm/detection.cpp @@ -77,7 +77,7 @@ static const DMADGameDescription gameDescriptions[] = { {"DemoDun.dat", 0, "78848e1a2d3d5a11e5954deb8c7b772b", 1209}, AD_LISTEND }, - Common::EN_ANY, Common::kPlatformAmiga, ADGF_NO_FLAGS, GUIO1(GUIO_NONE), + Common::EN_ANY, Common::kPlatformAmiga, ADGF_DEMO, GUIO1(GUIO_NONE), }, kDMSaveTargetDM21, kDMSaveFormatAmigaPC98FmTowns, kDMSavePlatformAtariSt, { kDMSaveTargetDM21, kDMSaveTargetEndOfList}, diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index cfed9eb894..25d741f376 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -68,6 +68,11 @@ #include "dm/sounds.h" namespace DM { + +bool DMEngine::isDemo() const { + return (bool)(_gameVersion->_desc.flags & ADGF_DEMO); +} + Direction DMEngine::turnDirRight(int16 dir) { Direction result = (Direction)((dir + 1) & 3); return result; diff --git a/engines/dm/dm.h b/engines/dm/dm.h index 6549db13b5..9056a744fb 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -211,7 +211,7 @@ public: // Note: F0026_MAIN_GetBoundedValue<T> has been replaced by CLIP<T> -#define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember)) +#define CALL_MEMBER_FN(object, ptrToMember) ((object).*(ptrToMember)) struct SaveGameHeader { byte _version; @@ -243,6 +243,8 @@ public: virtual Common::Error loadGameState(int slot); virtual bool canLoadGameStateCurrently(); + bool isDemo() const; + GUI::Debugger *getDebugger() { return _console; } void delay(uint16 verticalBlank); // @ F0022_MAIN_Delay diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 5746ee03c2..417f3e31e7 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -477,7 +477,14 @@ DungeonMan::~DungeonMan() { void DungeonMan::decompressDungeonFile() { Common::File f; - f.open("Dungeon.dat"); + if (_vm->isDemo()) + f.open("DemoDun.dat"); + else + f.open("Dungeon.dat"); + + if (!f.isOpen()) + error("Unable to open Dungeon.dat file"); + if (f.readUint16BE() == 0x8104) { // if dungeon is compressed _rawDunFileDataSize = f.readUint32BE(); delete[] _rawDunFileData; |