[Scummvm-git-logs] scummvm master -> 86e525c1ad917ecfd9a6b59d79c63c6cc1c7eec0

Strangerke Strangerke at scummvm.org
Tue Oct 11 21:57:39 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7c138231e0 DM: Handle demo dungeon file
86e525c1ad DM: Fix isSquareACorridorTeleporterPitOrDoor for the demo, set version of demo to 2.0


Commit: 7c138231e034f7434ee3968ca777b515666fb5c1
    https://github.com/scummvm/scummvm/commit/7c138231e034f7434ee3968ca777b515666fb5c1
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-10-11T21:44:01+02:00

Commit Message:
DM: Handle demo dungeon file

Changed paths:
    engines/dm/detection.cpp
    engines/dm/dm.cpp
    engines/dm/dm.h
    engines/dm/dungeonman.cpp



diff --git a/engines/dm/detection.cpp b/engines/dm/detection.cpp
index 8361ec3..e8ec79a 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 cfed9eb..25d741f 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 6549db1..9056a74 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 5746ee0..417f3e3 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;


Commit: 86e525c1ad917ecfd9a6b59d79c63c6cc1c7eec0
    https://github.com/scummvm/scummvm/commit/86e525c1ad917ecfd9a6b59d79c63c6cc1c7eec0
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-10-11T21:44:03+02:00

Commit Message:
DM: Fix isSquareACorridorTeleporterPitOrDoor for the demo, set version of demo to 2.0

Changed paths:
    engines/dm/detection.cpp
    engines/dm/group.cpp



diff --git a/engines/dm/detection.cpp b/engines/dm/detection.cpp
index e8ec79a..a8f44ac 100644
--- a/engines/dm/detection.cpp
+++ b/engines/dm/detection.cpp
@@ -71,7 +71,8 @@ static const DMADGameDescription gameDescriptions[] = {
 	    { kDMSavePlatformAcceptAny }
 	},
 	{
-		{"dm", "Amiga Demo v??? English",
+		// Added by Strangerke
+		{"dm", "Amiga Demo v2.0 English",
 			{
 				{"graphics.dat", 0, "3932c8359bb36c24291b09e915114d38", 192421},
 				{"DemoDun.dat", 0, "78848e1a2d3d5a11e5954deb8c7b772b", 1209},
@@ -90,12 +91,10 @@ static const DMADGameDescription gameDescriptions[] = {
 	}
 };
 
-
 static const ADExtraGuiOptionsMap optionsList[] = {
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 
-
 class DMMetaEngine : public AdvancedMetaEngine {
 public:
 	DMMetaEngine() : AdvancedMetaEngine(DM::gameDescriptions, sizeof(DMADGameDescription), DMGames, optionsList) {
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index b1d9766..cf748ff 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -1832,6 +1832,9 @@ Thing GroupMan::groupGetGenerated(CreatureType creatureType, int16 healthMultipl
 }
 
 bool GroupMan::isSquareACorridorTeleporterPitOrDoor(int16 mapX, int16 mapY) {
+	if (_vm->isDemo())
+		return false;
+
 	int16 squareType = Square(_vm->_dungeonMan->getSquare(mapX, mapY)).getType();
 
 	return ((squareType == kDMElementTypeCorridor) || (squareType == kDMElementTypeTeleporter)





More information about the Scummvm-git-logs mailing list