aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/xeen/events.cpp14
-rw-r--r--engines/xeen/events.h5
-rw-r--r--engines/xeen/resources.cpp3
-rw-r--r--engines/xeen/resources.h1
-rw-r--r--engines/xeen/town.cpp51
-rw-r--r--engines/xeen/town.h5
6 files changed, 78 insertions, 1 deletions
diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp
index 0f54214409..a4b0134d31 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 921ee56997..9a086b8f19 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 142d119862..5efed13623 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 4b59ac6998..515b6d6334 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 863ebce299..82093f87d8 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 a8d03f3d62..7381a60076 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 {