[Scummvm-git-logs] scummvm master -> 14f70d216abe98cc7150589a5cc92e13eefe98ec

dreammaster dreammaster at scummvm.org
Sun Dec 10 17:10:39 CET 2017


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

Summary:
14f70d216a XEEN: Implemented PyramidLocation class


Commit: 14f70d216abe98cc7150589a5cc92e13eefe98ec
    https://github.com/scummvm/scummvm/commit/14f70d216abe98cc7150589a5cc92e13eefe98ec
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-10T11:10:27-05:00

Commit Message:
XEEN: Implemented PyramidLocation class

Changed paths:
    engines/xeen/events.cpp
    engines/xeen/events.h
    engines/xeen/resources.cpp
    engines/xeen/resources.h
    engines/xeen/town.cpp
    engines/xeen/town.h


diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp
index 0f54214..a4b0134 100644
--- a/engines/xeen/events.cpp
+++ b/engines/xeen/events.cpp
@@ -167,6 +167,20 @@ void EventsManager::ipause5(uint amount) {
 	} while (!_vm->shouldQuit() && timeElapsed5() < amount);
 }
 
+void EventsManager::waitForPressAnimated() {
+	clearEvents();
+
+	do {
+		updateGameCounter();
+		_vm->_interface->draw3d(true);
+
+		while (!_vm->shouldQuit() && timeElapsed() == 0)
+			pollEventsAndWait();
+	} while (!_vm->shouldQuit() && !isKeyMousePressed());
+
+	clearEvents();
+}
+
 void EventsManager::nextFrame() {
 	++_frameCounter;
 
diff --git a/engines/xeen/events.h b/engines/xeen/events.h
index 921ee56..9a086b8 100644
--- a/engines/xeen/events.h
+++ b/engines/xeen/events.h
@@ -118,6 +118,11 @@ public:
 	 * Pauses a set amount past the previous call to timeMark5
 	 */
 	void ipause5(uint amount);
+
+	/**
+	 * Waits for a key or mouse press, animating the 3d view in the background
+	 */
+	void waitForPressAnimated();
 };
 
 class GameEvent {
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp
index 142d119..5efed13 100644
--- a/engines/xeen/resources.cpp
+++ b/engines/xeen/resources.cpp
@@ -1606,4 +1606,7 @@ const char *const Resources::EVENT_SAMPLES[6] = {
 	"ahh.voc", "whereto.voc", "gulp.voc", "null.voc", "scream.voc", "laff1.voc"
 };
 
+const char *const Resources::MOONS_NOT_ALIGNED =
+"\x3""c\xB""012\t000The moons are not aligned. Passage to the %s is unavailable";
+
 } // End of namespace Xeen
diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h
index 4b59ac6..515b6d6 100644
--- a/engines/xeen/resources.h
+++ b/engines/xeen/resources.h
@@ -343,6 +343,7 @@ public:
 	static const char *const MONSTER_SPECIAL_ATTACKS[23];
 	static const char *const IDENTIFY_MONSTERS;
 	static const char *const EVENT_SAMPLES[6];
+	static const char *const MOONS_NOT_ALIGNED;
 public:
 	/**
 	 * Initializes an instnace of the resources
diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp
index 863ebce..82093f8 100644
--- a/engines/xeen/town.cpp
+++ b/engines/xeen/town.cpp
@@ -1139,7 +1139,56 @@ SphinxLocation::SphinxLocation() : TownLocation(SPHINX) {
 /*------------------------------------------------------------------------*/
 
 PyramidLocation::PyramidLocation() : TownLocation(PYRAMID) {
-	// TODO
+}
+
+int PyramidLocation::show() {
+	EventsManager &events = *g_vm->_events;
+	Map &map = *g_vm->_map;
+	Party &party = *g_vm->_party;
+	Windows &windows = *g_vm->_windows;
+	int mapId;
+	Direction dir = DIR_NORTH;
+	Common::Point pt;
+
+	if (g_vm->getGameID() == GType_WorldOfXeen) {
+		if (_isDarkCc) {
+			if (party._mazeId == 52) {
+				mapId = 49;
+				pt = Common::Point(7, 14);
+				dir = DIR_SOUTH;
+			} else {
+				mapId = 23;
+				pt = Common::Point(8, 10);
+			}
+		} else {
+			if (party._mazeId == 49) {
+				mapId = 52;
+				pt = Common::Point(2, 2);
+			} else {
+				mapId = 29;
+				pt = Common::Point(25, 21);
+			}
+		}
+
+		// Load the destination map and set position and direction
+		map._loadDarkSide = !_isDarkCc;
+		map.load(mapId);
+		party._mazePosition = pt;
+		party._mazeDirection = dir;
+	} else {
+		// Playing Clouds or Dark Side on it's own, so can't switch sides
+		Window &win = windows[12];
+		Common::String msg = Common::String::format(Res.MOONS_NOT_ALIGNED,
+			_isDarkCc ? "Clouds" : "Darkside");
+		win.open();
+		win.writeString(msg);
+		win.update();
+
+		events.waitForPressAnimated();
+		win.close();
+	}
+
+	return 0;
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/xeen/town.h b/engines/xeen/town.h
index a8d03f3..7381a60 100644
--- a/engines/xeen/town.h
+++ b/engines/xeen/town.h
@@ -270,6 +270,11 @@ class PyramidLocation : public TownLocation {
 public:
 	PyramidLocation();
 	virtual ~PyramidLocation() {}
+
+	/**
+	 * Show the town location
+	 */
+	virtual int show();
 };
 
 class Town {





More information about the Scummvm-git-logs mailing list