aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pegasus')
-rw-r--r--engines/pegasus/pegasus.cpp17
-rw-r--r--engines/pegasus/pegasus.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index d9f296d3e2..fe140cd05b 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -75,6 +75,9 @@ PegasusEngine::~PegasusEngine() {
delete _cursor;
delete _continuePoint;
delete _gameMenu;
+ delete _neighborhood;
+
+ // NOTE: This must be deleted last!
delete _gfx;
}
@@ -1108,4 +1111,18 @@ tInventoryResult PegasusEngine::addItemToInventory(InventoryItem *item) {
return result;
}
+void PegasusEngine::useNeighborhood(Neighborhood *neighborhood) {
+ delete _neighborhood;
+ _neighborhood = neighborhood;
+
+ if (_neighborhood) {
+ InputHandler::setInputHandler(_neighborhood);
+ _neighborhood->init();
+ _neighborhood->moveNavTo(kNavAreaLeft, kNavAreaTop);
+ g_interface->setDate(_neighborhood->getDateResID());
+ } else {
+ InputHandler::setInputHandler(this);
+ }
+}
+
} // End of namespace Pegasus
diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h
index 4856da6258..d72b9d16c4 100644
--- a/engines/pegasus/pegasus.h
+++ b/engines/pegasus/pegasus.h
@@ -219,6 +219,7 @@ private:
// Neighborhood
Neighborhood *_neighborhood;
+ void useNeighborhood(Neighborhood *neighborhood);
// Sound
uint16 _ambientLevel;