diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/pegasus/hotspot.cpp | 2 | ||||
-rw-r--r-- | engines/pegasus/hotspot.h | 3 | ||||
-rw-r--r-- | engines/pegasus/items/biochips/opticalchip.cpp | 1 | ||||
-rw-r--r-- | engines/pegasus/items/inventory/airmask.cpp | 1 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/caldoria/caldoria.cpp | 42 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp | 1 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp | 1 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/mars/mars.cpp | 64 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/neighborhood.cpp | 16 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp | 32 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/norad/delta/noraddelta.cpp | 58 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/norad/pressuretracker.cpp | 1 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/prehistoric/prehistoric.cpp | 6 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/tsa/fulltsa.cpp | 20 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/wsc/wsc.cpp | 20 | ||||
-rw-r--r-- | engines/pegasus/pegasus.cpp | 10 | ||||
-rw-r--r-- | engines/pegasus/pegasus.h | 2 |
17 files changed, 142 insertions, 138 deletions
diff --git a/engines/pegasus/hotspot.cpp b/engines/pegasus/hotspot.cpp index 84731b7a06..d8b07a94f4 100644 --- a/engines/pegasus/hotspot.cpp +++ b/engines/pegasus/hotspot.cpp @@ -29,8 +29,6 @@ namespace Pegasus { -HotspotList g_allHotspots; - Region::Region(Common::ReadStream *stream) { uint16 length = stream->readUint16BE(); diff --git a/engines/pegasus/hotspot.h b/engines/pegasus/hotspot.h index bc1d054f0d..623609d862 100644 --- a/engines/pegasus/hotspot.h +++ b/engines/pegasus/hotspot.h @@ -145,8 +145,7 @@ public: typedef HotspotList::iterator HotspotIterator; -// FIXME: Remove global construction -extern HotspotList g_allHotspots; +#define g_allHotspots (((PegasusEngine *)g_engine)->getAllHotspots()) } // End of namespace Pegasus diff --git a/engines/pegasus/items/biochips/opticalchip.cpp b/engines/pegasus/items/biochips/opticalchip.cpp index 0f60981955..7b8858edae 100644 --- a/engines/pegasus/items/biochips/opticalchip.cpp +++ b/engines/pegasus/items/biochips/opticalchip.cpp @@ -23,6 +23,7 @@ * */ +#include "pegasus/pegasus.h" #include "pegasus/ai/ai_area.h" #include "pegasus/items/biochips/opticalchip.h" diff --git a/engines/pegasus/items/inventory/airmask.cpp b/engines/pegasus/items/inventory/airmask.cpp index 56f9d6f62f..559410fc79 100644 --- a/engines/pegasus/items/inventory/airmask.cpp +++ b/engines/pegasus/items/inventory/airmask.cpp @@ -24,6 +24,7 @@ */ #include "pegasus/gamestate.h" +#include "pegasus/pegasus.h" #include "pegasus/ai/ai_area.h" #include "pegasus/items/inventory/airmask.h" #include "pegasus/neighborhood/neighborhood.h" diff --git a/engines/pegasus/neighborhood/caldoria/caldoria.cpp b/engines/pegasus/neighborhood/caldoria/caldoria.cpp index a6806d5c46..6421195c8e 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoria.cpp +++ b/engines/pegasus/neighborhood/caldoria/caldoria.cpp @@ -1292,42 +1292,42 @@ void Caldoria::activateHotspots() { case kCaldoriaDrawers: if (getCurrentActivation() == kActivateRightOpen) { if (GameState.isTakenItemID(kKeyCard)) { - g_allHotspots.activateOneHotspot(kCaldoriaRightDrawerNoKeysCloseSpotID); - g_allHotspots.deactivateOneHotspot(kCaldoriaRightDrawerWithKeysCloseSpotID); + _vm->getAllHotspots().activateOneHotspot(kCaldoriaRightDrawerNoKeysCloseSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaRightDrawerWithKeysCloseSpotID); } else { - g_allHotspots.activateOneHotspot(kCaldoriaRightDrawerWithKeysCloseSpotID); - g_allHotspots.deactivateOneHotspot(kCaldoriaRightDrawerNoKeysCloseSpotID); + _vm->getAllHotspots().activateOneHotspot(kCaldoriaRightDrawerWithKeysCloseSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaRightDrawerNoKeysCloseSpotID); } } case kCaldoriaReplicator: if (GameState.getCaldoriaMadeOJ()) - g_allHotspots.deactivateOneHotspot(kCaldoriaMakeOJSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaMakeOJSpotID); break; case kCaldoria27: if (GameState.isCurrentDoorOpen()) { - g_allHotspots.deactivateOneHotspot(kCaldoriaFourthFloorElevator1); - g_allHotspots.deactivateOneHotspot(kCaldoriaFourthFloorElevator2); - g_allHotspots.deactivateOneHotspot(kCaldoriaFourthFloorElevator3); - g_allHotspots.deactivateOneHotspot(kCaldoriaFourthFloorElevator4); - g_allHotspots.deactivateOneHotspot(kCaldoriaFourthFloorElevator5); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaFourthFloorElevator1); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaFourthFloorElevator2); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaFourthFloorElevator3); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaFourthFloorElevator4); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaFourthFloorElevator5); } break; case kCaldoria28: if (GameState.isCurrentDoorOpen()) { - g_allHotspots.deactivateOneHotspot(kCaldoriaGroundElevator1); - g_allHotspots.deactivateOneHotspot(kCaldoriaGroundElevator2); - g_allHotspots.deactivateOneHotspot(kCaldoriaGroundElevator3); - g_allHotspots.deactivateOneHotspot(kCaldoriaGroundElevator4); - g_allHotspots.deactivateOneHotspot(kCaldoriaGroundElevator5); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaGroundElevator1); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaGroundElevator2); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaGroundElevator3); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaGroundElevator4); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaGroundElevator5); } break; case kCaldoria45: if (GameState.isCurrentDoorOpen()) { - g_allHotspots.deactivateOneHotspot(kCaldoriaRoofElevator1); - g_allHotspots.deactivateOneHotspot(kCaldoriaRoofElevator2); - g_allHotspots.deactivateOneHotspot(kCaldoriaRoofElevator3); - g_allHotspots.deactivateOneHotspot(kCaldoriaRoofElevator4); - g_allHotspots.deactivateOneHotspot(kCaldoriaRoofElevator5); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaRoofElevator1); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaRoofElevator2); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaRoofElevator3); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaRoofElevator4); + _vm->getAllHotspots().deactivateOneHotspot(kCaldoriaRoofElevator5); } break; } @@ -1576,7 +1576,7 @@ Hotspot *Caldoria::getItemScreenSpot(Item *item, DisplayElement *element) { if (destSpotID == kNoHotSpotID) return Neighborhood::getItemScreenSpot(item, element); - return g_allHotspots.findHotspotByID(destSpotID); + return _vm->getAllHotspots().findHotspotByID(destSpotID); } void Caldoria::pickedUpItem(Item *item) { diff --git a/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp b/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp index d8ac3b08cb..21ad7db955 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp +++ b/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp @@ -23,6 +23,7 @@ * */ +#include "pegasus/pegasus.h" #include "pegasus/ai/ai_area.h" #include "pegasus/neighborhood/caldoria/caldoria.h" #include "pegasus/neighborhood/caldoria/caldoria4dsystem.h" diff --git a/engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp b/engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp index 2b70ead442..ff4d1811d0 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp +++ b/engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp @@ -24,6 +24,7 @@ */ #include "pegasus/gamestate.h" +#include "pegasus/pegasus.h" #include "pegasus/neighborhood/neighborhood.h" #include "pegasus/neighborhood/caldoria/caldoria.h" #include "pegasus/neighborhood/caldoria/caldoriamirror.h" diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp index 816a13f01d..8c1098a73d 100644 --- a/engines/pegasus/neighborhood/mars/mars.cpp +++ b/engines/pegasus/neighborhood/mars/mars.cpp @@ -128,17 +128,17 @@ Mars::Mars(InputHandler *nextHandler, PegasusEngine *owner) : Neighborhood(nextH } Mars::~Mars() { - g_allHotspots.remove(&_energyChoiceSpot); - g_allHotspots.remove(&_gravitonChoiceSpot); - g_allHotspots.remove(&_tractorChoiceSpot); - g_allHotspots.remove(&_shuttleViewSpot); - g_allHotspots.remove(&_shuttleTransportSpot); + _vm->getAllHotspots().remove(&_energyChoiceSpot); + _vm->getAllHotspots().remove(&_gravitonChoiceSpot); + _vm->getAllHotspots().remove(&_tractorChoiceSpot); + _vm->getAllHotspots().remove(&_shuttleViewSpot); + _vm->getAllHotspots().remove(&_shuttleTransportSpot); } void Mars::init() { Neighborhood::init(); - Hotspot *attackSpot = g_allHotspots.findHotspotByID(kAttackRobotHotSpotID); + Hotspot *attackSpot = _vm->getAllHotspots().findHotspotByID(kAttackRobotHotSpotID); attackSpot->setMaskedHotspotFlags(kDropItemSpotFlag, kDropItemSpotFlag); _attackingItem = NULL; @@ -1627,35 +1627,35 @@ void Mars::activateHotspots() { switch (GameState.getCurrentRoomAndView()) { case MakeRoomView(kMars48, kEast): if ((_navMovie.getFlags() & kLoopTimeBase) != 0 && _vm->getDragType() == kDragInventoryUse) - g_allHotspots.activateOneHotspot(kAttackRobotHotSpotID); + _vm->getAllHotspots().activateOneHotspot(kAttackRobotHotSpotID); break; case MakeRoomView(kMars56, kEast): switch (getCurrentActivation()) { case kActivateReactorReadyForNitrogen: item = (InventoryItem *)g_allItems.findItemByID(kNitrogenCanister); if (item->getItemState() != kNitrogenFull) - g_allHotspots.deactivateOneHotspot(kMars57DropNitrogenSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kMars57DropNitrogenSpotID); // Fall through... case kActivateReactorReadyForCrowBar: - g_allHotspots.activateOneHotspot(kMars57CantOpenPanelSpotID); + _vm->getAllHotspots().activateOneHotspot(kMars57CantOpenPanelSpotID); break; } break; case MakeRoomView(kMarsRobotShuttle, kEast): if (_privateFlags.getFlag(kMarsPrivateGotMapChipFlag)) - g_allHotspots.deactivateOneHotspot(kRobotShuttleMapChipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kRobotShuttleMapChipSpotID); else - g_allHotspots.activateOneHotspot(kRobotShuttleMapChipSpotID); + _vm->getAllHotspots().activateOneHotspot(kRobotShuttleMapChipSpotID); if (_privateFlags.getFlag(kMarsPrivateGotOpticalChipFlag)) - g_allHotspots.deactivateOneHotspot(kRobotShuttleOpticalChipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kRobotShuttleOpticalChipSpotID); else - g_allHotspots.activateOneHotspot(kRobotShuttleOpticalChipSpotID); + _vm->getAllHotspots().activateOneHotspot(kRobotShuttleOpticalChipSpotID); if (_privateFlags.getFlag(kMarsPrivateGotShieldChipFlag)) - g_allHotspots.deactivateOneHotspot(kRobotShuttleShieldChipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kRobotShuttleShieldChipSpotID); else - g_allHotspots.activateOneHotspot(kRobotShuttleShieldChipSpotID); + _vm->getAllHotspots().activateOneHotspot(kRobotShuttleShieldChipSpotID); break; default: if (_privateFlags.getFlag(kMarsPrivateInSpaceChaseFlag)) { @@ -1868,7 +1868,7 @@ Hotspot *Mars::getItemScreenSpot(Item *item, DisplayElement *element) { if (destSpotID == kNoHotSpotID) return Neighborhood::getItemScreenSpot(item, element); - return g_allHotspots.findHotspotByID(destSpotID); + return _vm->getAllHotspots().findHotspotByID(destSpotID); } void Mars::takeItemFromRoom(Item *item) { @@ -2635,7 +2635,7 @@ void Mars::startUpFromFinishedSpaceChase() { _shuttleTransportSpot.setArea(kShuttleTransportBounds); _shuttleTransportSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_shuttleTransportSpot); + _vm->getAllHotspots().push_back(&_shuttleTransportSpot); _privateFlags.setFlag(kMarsPrivateInSpaceChaseFlag, true); @@ -2766,20 +2766,20 @@ void Mars::startUpFromSpaceChase() { _energyChoiceSpot.setArea(kShuttleEnergyBeamBounds); _energyChoiceSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_energyChoiceSpot); + _vm->getAllHotspots().push_back(&_energyChoiceSpot); _gravitonChoiceSpot.setArea(kShuttleGravitonBounds); _gravitonChoiceSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_gravitonChoiceSpot); + _vm->getAllHotspots().push_back(&_gravitonChoiceSpot); _tractorChoiceSpot.setArea(kShuttleTractorBounds); _tractorChoiceSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_tractorChoiceSpot); + _vm->getAllHotspots().push_back(&_tractorChoiceSpot); _shuttleViewSpot.setArea(kShuttleWindowLeft, kShuttleWindowTop, kShuttleWindowLeft + kShuttleWindowWidth, kShuttleWindowTop + kShuttleWindowHeight); _shuttleViewSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_shuttleViewSpot); + _vm->getAllHotspots().push_back(&_shuttleViewSpot); _shuttleTransportSpot.setArea(kShuttleTransportBounds); _shuttleTransportSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_shuttleTransportSpot); + _vm->getAllHotspots().push_back(&_shuttleTransportSpot); _privateFlags.setFlag(kMarsPrivateInSpaceChaseFlag, true); @@ -2900,20 +2900,20 @@ void Mars::marsTimerExpired(MarsTimerEvent &event) { _energyChoiceSpot.setArea(kShuttleEnergyBeamBounds); _energyChoiceSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_energyChoiceSpot); + _vm->getAllHotspots().push_back(&_energyChoiceSpot); _gravitonChoiceSpot.setArea(kShuttleGravitonBounds); _gravitonChoiceSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_gravitonChoiceSpot); + _vm->getAllHotspots().push_back(&_gravitonChoiceSpot); _tractorChoiceSpot.setArea(kShuttleTractorBounds); _tractorChoiceSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_tractorChoiceSpot); + _vm->getAllHotspots().push_back(&_tractorChoiceSpot); _shuttleViewSpot.setArea(kShuttleWindowLeft, kShuttleWindowTop, kShuttleWindowLeft + kShuttleWindowWidth, kShuttleWindowTop + kShuttleWindowHeight); _shuttleViewSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_shuttleViewSpot); + _vm->getAllHotspots().push_back(&_shuttleViewSpot); _shuttleTransportSpot.setArea(kShuttleTransportBounds); _shuttleTransportSpot.setHotspotFlags(kNeighborhoodSpotFlag | kClickSpotFlag); - g_allHotspots.push_back(&_shuttleTransportSpot); + _vm->getAllHotspots().push_back(&_shuttleTransportSpot); _privateFlags.setFlag(kMarsPrivateInSpaceChaseFlag, true); @@ -3008,11 +3008,11 @@ void Mars::throwAwayMarsShuttle() { _junk.stopDisplaying(); _energyBeam.cleanUpShuttleWeapon(); _gravitonCannon.cleanUpShuttleWeapon(); - g_allHotspots.remove(&_energyChoiceSpot); - g_allHotspots.remove(&_gravitonChoiceSpot); - g_allHotspots.remove(&_tractorChoiceSpot); - g_allHotspots.remove(&_shuttleViewSpot); - g_allHotspots.remove(&_shuttleTransportSpot); + _vm->getAllHotspots().remove(&_energyChoiceSpot); + _vm->getAllHotspots().remove(&_gravitonChoiceSpot); + _vm->getAllHotspots().remove(&_tractorChoiceSpot); + _vm->getAllHotspots().remove(&_shuttleViewSpot); + _vm->getAllHotspots().remove(&_shuttleTransportSpot); _explosions.releaseMovie(); _explosions.stopDisplaying(); diff --git a/engines/pegasus/neighborhood/neighborhood.cpp b/engines/pegasus/neighborhood/neighborhood.cpp index 3378459a5d..a93dd7e0a7 100644 --- a/engines/pegasus/neighborhood/neighborhood.cpp +++ b/engines/pegasus/neighborhood/neighborhood.cpp @@ -73,7 +73,7 @@ Neighborhood::Neighborhood(InputHandler *nextHandler, PegasusEngine *vm, const C Neighborhood::~Neighborhood() { for (HotspotIterator it = _neighborhoodHotspots.begin(); it != _neighborhoodHotspots.end(); it++) - g_allHotspots.remove(*it); + _vm->getAllHotspots().remove(*it); _neighborhoodHotspots.deleteHotspots(); g_neighborhood = 0; @@ -381,7 +381,7 @@ void Neighborhood::createNeighborhoodSpots() { hotspot->setHotspotFlags(flags); hotspot->setArea(region); - g_allHotspots.push_back(hotspot); + _vm->getAllHotspots().push_back(hotspot); _neighborhoodHotspots.push_back(hotspot); } @@ -655,7 +655,7 @@ void Neighborhood::activateHotspots() { if (entry.hotspotRoom == GameState.getCurrentRoom() && entry.hotspotDirection == GameState.getCurrentDirection() && (entry.hotspotActivation == _currentActivation || entry.hotspotActivation == kActivateHotSpotAlways)) { - Hotspot *hotspot = g_allHotspots.findHotspotByID(entry.hotspot); + Hotspot *hotspot = _vm->getAllHotspots().findHotspotByID(entry.hotspot); if (hotspot) activateOneHotspot(entry, hotspot); } @@ -1242,7 +1242,7 @@ void Neighborhood::throwAwayInterface() { _turnPush.disposeAllCallBacks(); for (HotspotList::iterator it = _neighborhoodHotspots.begin(); it != _neighborhoodHotspots.end(); it++) - g_allHotspots.remove(*it); + _vm->getAllHotspots().remove(*it); _neighborhoodHotspots.deleteHotspots(); _spotSounds.disposeSound(); @@ -1428,7 +1428,7 @@ void Neighborhood::bumpIntoWall() { void Neighborhood::zoomUpOrBump() { Hotspot *zoomSpot = 0; - for (HotspotList::iterator it = g_allHotspots.begin(); it != g_allHotspots.end(); it++) { + for (HotspotList::iterator it = _vm->getAllHotspots().begin(); it != _vm->getAllHotspots().end(); it++) { Hotspot *hotspot = *it; if ((hotspot->getHotspotFlags() & (kNeighborhoodSpotFlag | kZoomInSpotFlag)) == (kNeighborhoodSpotFlag | kZoomInSpotFlag)) { @@ -1652,7 +1652,7 @@ void Neighborhood::handleInput(const Input &input, const Hotspot *cursorSpot) { } void Neighborhood::setHotspotFlags(const HotSpotID id, const HotSpotFlags flags) { - Hotspot *hotspot = g_allHotspots.findHotspotByID(id); + Hotspot *hotspot = _vm->getAllHotspots().findHotspotByID(id); hotspot->setMaskedHotspotFlags(flags, flags); } @@ -1674,10 +1674,10 @@ void Neighborhood::rightButton(const Input &) { void Neighborhood::downButton(const Input &) { if (_inputHandler->wantsCursor()) { - g_allHotspots.deactivateAllHotspots(); + _vm->getAllHotspots().deactivateAllHotspots(); _inputHandler->activateHotspots(); - for (HotspotList::iterator it = g_allHotspots.begin(); it != g_allHotspots.end(); it++) { + for (HotspotList::iterator it = _vm->getAllHotspots().begin(); it != _vm->getAllHotspots().end(); it++) { Hotspot *hotspot = *it; if (hotspot->isSpotActive() && (hotspot->getHotspotFlags() & (kNeighborhoodSpotFlag | kZoomOutSpotFlag)) == (kNeighborhoodSpotFlag | kZoomOutSpotFlag)) { diff --git a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp index 8391a3ff10..2d050d9aa5 100644 --- a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp +++ b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp @@ -100,27 +100,27 @@ NoradAlpha::NoradAlpha(InputHandler *nextHandler, PegasusEngine *owner) : Norad( void NoradAlpha::init() { Norad::init(); - Hotspot *hotspot = g_allHotspots.findHotspotByID(kN01GasCanisterSpotID); + Hotspot *hotspot = _vm->getAllHotspots().findHotspotByID(kN01GasCanisterSpotID); hotspot->setMaskedHotspotFlags(kPickUpItemSpotFlag, kPickUpItemSpotFlag); HotspotInfoTable::Entry *hotspotEntry = findHotspotEntry(kN01GasCanisterSpotID); hotspotEntry->hotspotItem = kGasCanister; - hotspot = g_allHotspots.findHotspotByID(kN01ArgonCanisterSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kN01ArgonCanisterSpotID); hotspot->setMaskedHotspotFlags(kPickUpItemSpotFlag, kPickUpItemSpotFlag); hotspotEntry = findHotspotEntry(kN01ArgonCanisterSpotID); hotspotEntry->hotspotItem = kArgonCanister; - hotspot = g_allHotspots.findHotspotByID(kN01NitrogenCanisterSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kN01NitrogenCanisterSpotID); hotspot->setMaskedHotspotFlags(kPickUpItemSpotFlag, kPickUpItemSpotFlag); hotspotEntry = findHotspotEntry(kN01NitrogenCanisterSpotID); hotspotEntry->hotspotItem = kNitrogenCanister; - hotspot = g_allHotspots.findHotspotByID(kN01AirMaskSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kN01AirMaskSpotID); hotspot->setMaskedHotspotFlags(kPickUpItemSpotFlag, kPickUpItemSpotFlag); hotspotEntry = findHotspotEntry(kN01AirMaskSpotID); hotspotEntry->hotspotItem = kAirMask; - hotspot = g_allHotspots.findHotspotByID(kN01GasOutletSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kN01GasOutletSpotID); hotspot->setMaskedHotspotFlags(kDropItemSpotFlag, kDropItemSpotFlag); } @@ -514,7 +514,7 @@ void NoradAlpha::activateHotspots() { ItemID itemID = _vm->getDraggingItem()->getObjectID(); if (itemID == kArgonCanister || itemID == kGasCanister || itemID == kAirMask || itemID == kNitrogenCanister) - g_allHotspots.activateOneHotspot(kN01GasOutletSpotID); + _vm->getAllHotspots().activateOneHotspot(kN01GasOutletSpotID); } } else { HotSpotID spotID; @@ -523,35 +523,35 @@ void NoradAlpha::activateHotspots() { switch (_fillingStationItem->getObjectID()) { case kArgonCanister: spotID = kN01ArgonCanisterSpotID; - g_allHotspots.deactivateOneHotspot(kNorad01GasOutSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad01GasOutSpotID); break; case kGasCanister: spotID = kN01GasCanisterSpotID; break; case kAirMask: spotID = kN01AirMaskSpotID; - g_allHotspots.deactivateOneHotspot(kNorad01GasOutSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad01GasOutSpotID); break; case kNitrogenCanister: spotID = kN01NitrogenCanisterSpotID; - g_allHotspots.deactivateOneHotspot(kNorad01GasOutSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad01GasOutSpotID); break; default: // Should never happen. spotID = kNoHotSpotID; break; } - g_allHotspots.activateOneHotspot(spotID); + _vm->getAllHotspots().activateOneHotspot(spotID); } } break; case MakeRoomView(kNorad10, kEast): if (GameState.isCurrentDoorOpen()) - g_allHotspots.deactivateOneHotspot(kNorad10DoorSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad10DoorSpotID); break; case MakeRoomView(kNorad21, kWest): if (GameState.isCurrentDoorOpen()) - g_allHotspots.deactivateOneHotspot(kNorad21WestSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad21WestSpotID); break; } } @@ -616,13 +616,13 @@ void NoradAlpha::getClawInfo(HotSpotID &outSpotID, HotSpotID &prepSpotID, HotSpo Hotspot *NoradAlpha::getItemScreenSpot(Item *item, DisplayElement *element) { switch (item->getObjectID()) { case kGasCanister: - return g_allHotspots.findHotspotByID(kN01GasCanisterSpotID); + return _vm->getAllHotspots().findHotspotByID(kN01GasCanisterSpotID); case kAirMask: - return g_allHotspots.findHotspotByID(kN01AirMaskSpotID); + return _vm->getAllHotspots().findHotspotByID(kN01AirMaskSpotID); case kArgonCanister: - return g_allHotspots.findHotspotByID(kN01ArgonCanisterSpotID); + return _vm->getAllHotspots().findHotspotByID(kN01ArgonCanisterSpotID); case kNitrogenCanister: - return g_allHotspots.findHotspotByID(kN01NitrogenCanisterSpotID); + return _vm->getAllHotspots().findHotspotByID(kN01NitrogenCanisterSpotID); } return Norad::getItemScreenSpot(item, element); diff --git a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp index 2b208aab71..cf21f7744f 100644 --- a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp +++ b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp @@ -102,38 +102,38 @@ void NoradDelta::init() { Norad::init(); // Little fix for the retinal scan zoom in spot... - Hotspot *hotspot = g_allHotspots.findHotspotByID(kNorad68WestSpotID); + Hotspot *hotspot = _vm->getAllHotspots().findHotspotByID(kNorad68WestSpotID); hotspot->setMaskedHotspotFlags(kZoomInSpotFlag, kZoomInSpotFlag | kZoomOutSpotFlag); - hotspot = g_allHotspots.findHotspotByID(kNorad79WestSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kNorad79WestSpotID); hotspot->setMaskedHotspotFlags(kZoomInSpotFlag, kZoomInSpotFlag | kZoomOutSpotFlag); - hotspot = g_allHotspots.findHotspotByID(kDelta59RobotShieldBiochipSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kDelta59RobotShieldBiochipSpotID); hotspot->setMaskedHotspotFlags(kPickUpBiochipSpotFlag, kPickUpBiochipSpotFlag); HotspotInfoTable::Entry *hotspotEntry = findHotspotEntry(kDelta59RobotShieldBiochipSpotID); hotspotEntry->hotspotItem = kShieldBiochip; - hotspot = g_allHotspots.findHotspotByID(kDelta59RobotOpMemBiochipSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kDelta59RobotOpMemBiochipSpotID); hotspot->setMaskedHotspotFlags(kPickUpBiochipSpotFlag, kPickUpBiochipSpotFlag); hotspotEntry = findHotspotEntry(kDelta59RobotOpMemBiochipSpotID); hotspotEntry->hotspotItem = kOpticalBiochip; - hotspot = g_allHotspots.findHotspotByID(kDelta59RobotRetinalBiochipSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kDelta59RobotRetinalBiochipSpotID); hotspot->setMaskedHotspotFlags(kPickUpBiochipSpotFlag, kPickUpBiochipSpotFlag); hotspotEntry = findHotspotEntry(kDelta59RobotRetinalBiochipSpotID); hotspotEntry->hotspotItem = kRetinalScanBiochip; - hotspot = g_allHotspots.findHotspotByID(kDelta60RobotShieldBiochipSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kDelta60RobotShieldBiochipSpotID); hotspot->setMaskedHotspotFlags(kPickUpBiochipSpotFlag, kPickUpBiochipSpotFlag); hotspotEntry = findHotspotEntry(kDelta60RobotShieldBiochipSpotID); hotspotEntry->hotspotItem = kShieldBiochip; - hotspot = g_allHotspots.findHotspotByID(kDelta60RobotOpMemBiochipSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kDelta60RobotOpMemBiochipSpotID); hotspot->setMaskedHotspotFlags(kPickUpBiochipSpotFlag, kPickUpBiochipSpotFlag); hotspotEntry = findHotspotEntry(kDelta60RobotOpMemBiochipSpotID); hotspotEntry->hotspotItem = kOpticalBiochip; - hotspot = g_allHotspots.findHotspotByID(kDelta60RobotRetinalBiochipSpotID); + hotspot = _vm->getAllHotspots().findHotspotByID(kDelta60RobotRetinalBiochipSpotID); hotspot->setMaskedHotspotFlags(kPickUpBiochipSpotFlag, kPickUpBiochipSpotFlag); hotspotEntry = findHotspotEntry(kDelta60RobotRetinalBiochipSpotID); hotspotEntry->hotspotItem = kRetinalScanBiochip; @@ -508,7 +508,7 @@ TimeValue NoradDelta::getViewTime(const RoomID room, const DirectionConstant dir void NoradDelta::openDoor() { if (GameState.getCurrentRoom() == kNorad59 && GameState.getCurrentDirection() == kWest && GameState.getNoradPlayedGlobeGame()) { Input scratch; - InputHandler::_inputHandler->clickInHotspot(scratch, g_allHotspots.findHotspotByID(kNorad59WestSpotID)); + InputHandler::_inputHandler->clickInHotspot(scratch, _vm->getAllHotspots().findHotspotByID(kNorad59WestSpotID)); } else { Norad::openDoor(); } @@ -518,53 +518,53 @@ void NoradDelta::activateHotspots() { Norad::activateHotspots(); if (GameState.getCurrentRoom() == kNorad59West && GameState.getCurrentDirection() == kWest && GameState.getNoradBeatRobotWithDoor()) { - g_allHotspots.deactivateOneHotspot(kNorad59WestOutSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad59WestOutSpotID); if (_privateFlags.getFlag(kNoradPrivateRobotHeadOpenFlag)) { if (!_privateFlags.getFlag(kNoradPrivateGotShieldChipFlag)) - g_allHotspots.activateOneHotspot(kDelta59RobotShieldBiochipSpotID); + _vm->getAllHotspots().activateOneHotspot(kDelta59RobotShieldBiochipSpotID); else - g_allHotspots.deactivateOneHotspot(kDelta59RobotShieldBiochipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kDelta59RobotShieldBiochipSpotID); if (!_privateFlags.getFlag(kNoradPrivateGotOpticalChipFlag)) - g_allHotspots.activateOneHotspot(kDelta59RobotOpMemBiochipSpotID); + _vm->getAllHotspots().activateOneHotspot(kDelta59RobotOpMemBiochipSpotID); else - g_allHotspots.deactivateOneHotspot(kDelta59RobotOpMemBiochipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kDelta59RobotOpMemBiochipSpotID); if (!_privateFlags.getFlag(kNoradPrivateGotRetScanChipFlag)) - g_allHotspots.activateOneHotspot(kDelta59RobotRetinalBiochipSpotID); + _vm->getAllHotspots().activateOneHotspot(kDelta59RobotRetinalBiochipSpotID); else - g_allHotspots.deactivateOneHotspot(kDelta59RobotRetinalBiochipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kDelta59RobotRetinalBiochipSpotID); } else - g_allHotspots.activateOneHotspot(kDelta59RobotHeadSpotID); + _vm->getAllHotspots().activateOneHotspot(kDelta59RobotHeadSpotID); } else if (GameState.getCurrentRoom() == kNorad60West && GameState.getCurrentDirection() == kWest && GameState.getNoradBeatRobotWithClaw()) { - g_allHotspots.deactivateOneHotspot(kNorad60MonitorOutSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad60MonitorOutSpotID); if (_privateFlags.getFlag(kNoradPrivateRobotHeadOpenFlag)) { if (!_privateFlags.getFlag(kNoradPrivateGotShieldChipFlag)) - g_allHotspots.activateOneHotspot(kDelta60RobotShieldBiochipSpotID); + _vm->getAllHotspots().activateOneHotspot(kDelta60RobotShieldBiochipSpotID); else - g_allHotspots.deactivateOneHotspot(kDelta60RobotShieldBiochipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kDelta60RobotShieldBiochipSpotID); if (!_privateFlags.getFlag(kNoradPrivateGotOpticalChipFlag)) - g_allHotspots.activateOneHotspot(kDelta60RobotOpMemBiochipSpotID); + _vm->getAllHotspots().activateOneHotspot(kDelta60RobotOpMemBiochipSpotID); else - g_allHotspots.deactivateOneHotspot(kDelta60RobotOpMemBiochipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kDelta60RobotOpMemBiochipSpotID); if (!_privateFlags.getFlag(kNoradPrivateGotRetScanChipFlag)) - g_allHotspots.activateOneHotspot(kDelta60RobotRetinalBiochipSpotID); + _vm->getAllHotspots().activateOneHotspot(kDelta60RobotRetinalBiochipSpotID); else - g_allHotspots.deactivateOneHotspot(kDelta60RobotRetinalBiochipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kDelta60RobotRetinalBiochipSpotID); } else { - g_allHotspots.activateOneHotspot(kDelta60RobotHeadSpotID); + _vm->getAllHotspots().activateOneHotspot(kDelta60RobotHeadSpotID); } } else if (GameState.getCurrentRoomAndView() == MakeRoomView(kNorad50, kEast)) { if (GameState.isCurrentDoorOpen()) - g_allHotspots.deactivateOneHotspot(kNorad50DoorSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad50DoorSpotID); } else if (GameState.getCurrentRoomAndView() == MakeRoomView(kNorad59, kWest)) { if (GameState.isCurrentDoorOpen()) - g_allHotspots.deactivateOneHotspot(kNorad59WestSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kNorad59WestSpotID); } } @@ -726,7 +726,7 @@ Hotspot *NoradDelta::getItemScreenSpot(Item *item, DisplayElement *element) { } if (id != kNoHotSpotID) - return g_allHotspots.findHotspotByID(id); + return _vm->getAllHotspots().findHotspotByID(id); return Norad::getItemScreenSpot(item, element); } @@ -852,7 +852,7 @@ void NoradDelta::doSolve() { if (biochip != 0 && biochip->getObjectID() != kRetinalScanBiochip && g_interface) g_interface->setCurrentBiochipID(kRetinalScanBiochip); - Hotspot *spot = g_allHotspots.findHotspotByID(kNorad68WestSpotID); + Hotspot *spot = _vm->getAllHotspots().findHotspotByID(kNorad68WestSpotID); Input scratch; InputHandler::_inputHandler->clickInHotspot(scratch, spot); } diff --git a/engines/pegasus/neighborhood/norad/pressuretracker.cpp b/engines/pegasus/neighborhood/norad/pressuretracker.cpp index 60521a4a98..5aac19dcbe 100644 --- a/engines/pegasus/neighborhood/norad/pressuretracker.cpp +++ b/engines/pegasus/neighborhood/norad/pressuretracker.cpp @@ -24,6 +24,7 @@ */ #include "pegasus/hotspot.h" +#include "pegasus/pegasus.h" #include "pegasus/neighborhood/norad/pressuredoor.h" #include "pegasus/neighborhood/norad/pressuretracker.h" diff --git a/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp b/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp index b67d31ad95..dcc00ab651 100644 --- a/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp +++ b/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp @@ -493,10 +493,10 @@ void Prehistoric::activateHotspots() { switch (GameState.getCurrentRoomAndView()) { case MakeRoomView(kPrehistoric18, kEast): if (!_privateFlags.getFlag(kPrehistoricPrivateExtendedBridgeFlag)) - g_allHotspots.activateOneHotspot(kPre18EastSpotID); + _vm->getAllHotspots().activateOneHotspot(kPre18EastSpotID); break; case MakeRoomView(kPrehistoric22North, kNorth): - g_allHotspots.activateOneHotspot(kPre22NorthBreakerSpotID); + _vm->getAllHotspots().activateOneHotspot(kPre22NorthBreakerSpotID); break; } } @@ -639,7 +639,7 @@ void Prehistoric::doSolve() { Hotspot *Prehistoric::getItemScreenSpot(Item *item, DisplayElement *element) { if (item->getObjectID() == kHistoricalLog) - return g_allHotspots.findHotspotByID(kPrehistoricHistoricalLogSpotID); + return _vm->getAllHotspots().findHotspotByID(kPrehistoricHistoricalLogSpotID); return Neighborhood::getItemScreenSpot(item, element); } diff --git a/engines/pegasus/neighborhood/tsa/fulltsa.cpp b/engines/pegasus/neighborhood/tsa/fulltsa.cpp index ccc08348fa..bb7a701200 100644 --- a/engines/pegasus/neighborhood/tsa/fulltsa.cpp +++ b/engines/pegasus/neighborhood/tsa/fulltsa.cpp @@ -1329,7 +1329,7 @@ void FullTSA::activateHotspots() { switch (MakeRoomView(GameState.getCurrentRoom(), GameState.getCurrentDirection())) { case MakeRoomView(kTSA02, kNorth): if (!GameState.getTSAFrontDoorUnlockedOutside()) - g_allHotspots.activateOneHotspot(kTSA02DoorSpotID); + _vm->getAllHotspots().activateOneHotspot(kTSA02DoorSpotID); break; case MakeRoomView(kTSA0B, kEast): if (GameState.getTSA0BZoomedIn()) @@ -1340,10 +1340,10 @@ void FullTSA::activateHotspots() { case kRobotsAtFrontDoor: case kRobotsAtReadyRoom: if (getCurrentActivation() != kActivateTSA0BComparisonVideo) { - g_allHotspots.activateOneHotspot(kTSA0BEastCompareNoradSpotID); - g_allHotspots.activateOneHotspot(kTSA0BEastCompareMarsSpotID); - g_allHotspots.activateOneHotspot(kTSA0BEastCompareCaldoriaSpotID); - g_allHotspots.activateOneHotspot(kTSA0BEastCompareWSCSpotID); + _vm->getAllHotspots().activateOneHotspot(kTSA0BEastCompareNoradSpotID); + _vm->getAllHotspots().activateOneHotspot(kTSA0BEastCompareMarsSpotID); + _vm->getAllHotspots().activateOneHotspot(kTSA0BEastCompareCaldoriaSpotID); + _vm->getAllHotspots().activateOneHotspot(kTSA0BEastCompareWSCSpotID); } break; } @@ -1354,9 +1354,9 @@ void FullTSA::activateHotspots() { case kRobotsAtCommandCenter: case kRobotsAtFrontDoor: case kRobotsAtReadyRoom: - g_allHotspots.activateOneHotspot(kTSA0BNorthRobotsToCommandCenterSpotID); - g_allHotspots.activateOneHotspot(kTSA0BNorthRobotsToReadyRoomSpotID); - g_allHotspots.activateOneHotspot(kTSA0BNorthRobotsToFrontDoorSpotID); + _vm->getAllHotspots().activateOneHotspot(kTSA0BNorthRobotsToCommandCenterSpotID); + _vm->getAllHotspots().activateOneHotspot(kTSA0BNorthRobotsToReadyRoomSpotID); + _vm->getAllHotspots().activateOneHotspot(kTSA0BNorthRobotsToFrontDoorSpotID); break; } break; @@ -2814,10 +2814,10 @@ void FullTSA::initializePegasusButtons(bool resolved) { Hotspot *FullTSA::getItemScreenSpot(Item *item, DisplayElement *element) { switch (item->getObjectID()) { case kJourneymanKey: - return g_allHotspots.findHotspotByID(kTSA22EastKeySpotID); + return _vm->getAllHotspots().findHotspotByID(kTSA22EastKeySpotID); break; case kPegasusBiochip: - return g_allHotspots.findHotspotByID(kTSA23WestChipsSpotID); + return _vm->getAllHotspots().findHotspotByID(kTSA23WestChipsSpotID); break; } diff --git a/engines/pegasus/neighborhood/wsc/wsc.cpp b/engines/pegasus/neighborhood/wsc/wsc.cpp index 1f00999aa7..39fbe37648 100644 --- a/engines/pegasus/neighborhood/wsc/wsc.cpp +++ b/engines/pegasus/neighborhood/wsc/wsc.cpp @@ -1572,7 +1572,7 @@ void WSC::arriveAt(const RoomID room, const DirectionConstant dir) { } else { if (GameState.getWSCCatwalkDark()) { // Change the gun hot spot... - g_allHotspots.setHotspotRect(kW98StunGunSpotID, Common::Rect(181 + kNavAreaLeft, + _vm->getAllHotspots().setHotspotRect(kW98StunGunSpotID, Common::Rect(181 + kNavAreaLeft, 99 + kNavAreaTop,372 + kNavAreaLeft, 149 + kNavAreaTop)); } setCurrentActivation(kActivationRobotGone); @@ -1906,7 +1906,7 @@ void WSC::receiveNotification(Notification *notification, const NotificationFlag case kW98RobotShocked: GameState.setWSCCatwalkDark(true); // Change the gun hot spot... - g_allHotspots.setHotspotRect(kW98StunGunSpotID, Common::Rect(181 + kNavAreaLeft, 99 + kNavAreaTop, + _vm->getAllHotspots().setHotspotRect(kW98StunGunSpotID, Common::Rect(181 + kNavAreaLeft, 99 + kNavAreaTop, 372 + kNavAreaLeft, 149 + kNavAreaTop)); setCurrentActivation(kActivationRobotDead); GameState.setWSCRobotDead(true); @@ -2124,19 +2124,19 @@ void WSC::activateHotspots() { if (GameState.getCurrentRoomAndView() == MakeRoomView(kWSC98, kWest) && _privateFlags.getFlag(kWSCPrivateRobotHeadOpenFlag)) { if (_privateFlags.getFlag(kWSCPrivateGotRetScanChipFlag)) - g_allHotspots.deactivateOneHotspot(kW98RetinalChipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kW98RetinalChipSpotID); else - g_allHotspots.activateOneHotspot(kW98RetinalChipSpotID); + _vm->getAllHotspots().activateOneHotspot(kW98RetinalChipSpotID); if (_privateFlags.getFlag(kWSCPrivateGotMapChipFlag)) - g_allHotspots.deactivateOneHotspot(kW98MapChipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kW98MapChipSpotID); else - g_allHotspots.activateOneHotspot(kW98MapChipSpotID); + _vm->getAllHotspots().activateOneHotspot(kW98MapChipSpotID); if (_privateFlags.getFlag(kWSCPrivateGotOpticalChipFlag)) - g_allHotspots.deactivateOneHotspot(kW98OpticalChipSpotID); + _vm->getAllHotspots().deactivateOneHotspot(kW98OpticalChipSpotID); else - g_allHotspots.activateOneHotspot(kW98OpticalChipSpotID); + _vm->getAllHotspots().activateOneHotspot(kW98OpticalChipSpotID); } } @@ -2324,7 +2324,7 @@ Hotspot *WSC::getItemScreenSpot(Item *item, DisplayElement *element) { if (destSpotID == kNoHotSpotID) return Neighborhood::getItemScreenSpot(item, element); - return g_allHotspots.findHotspotByID(destSpotID); + return _vm->getAllHotspots().findHotspotByID(destSpotID); } void WSC::pickedUpItem(Item *item) { @@ -2346,7 +2346,7 @@ void WSC::pickedUpItem(Item *item) { _vm->addItemToInventory((InventoryItem *)item); item = (Item *)g_allItems.findItemByID(kSinclairKey); _vm->addItemToInventory((InventoryItem *)item); - g_allHotspots.setHotspotRect(kWSC02SouthMorphOutSpotID, + _vm->getAllHotspots().setHotspotRect(kWSC02SouthMorphOutSpotID, Common::Rect(kNavAreaLeft, kNavAreaTop, 512 + kNavAreaLeft, 256 + kNavAreaTop)); break; case kArgonCanister: diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp index bbe2e0e212..ad0abc2186 100644 --- a/engines/pegasus/pegasus.cpp +++ b/engines/pegasus/pegasus.cpp @@ -161,7 +161,7 @@ Common::Error PegasusEngine::run() { _returnHotspot.setArea(Common::Rect(kNavAreaLeft, kNavAreaTop, 512 + kNavAreaLeft, 256 + kNavAreaTop)); _returnHotspot.setHotspotFlags(kInfoReturnSpotFlag); - g_allHotspots.push_back(&_returnHotspot); + _allHotspots.push_back(&_returnHotspot); _screenDimmer.setBounds(Common::Rect(0, 0, 640, 480)); _screenDimmer.setDisplayOrder(kScreenDimmerOrder); @@ -1839,15 +1839,15 @@ void PegasusEngine::shellGameInput(const Input &input, const Hotspot *cursorSpot void PegasusEngine::activateHotspots() { if (_gameMode == kModeInfoScreen) { - g_allHotspots.activateOneHotspot(kInfoReturnSpotID); + _allHotspots.activateOneHotspot(kInfoReturnSpotID); } else { // Set up hot spots. if (_dragType == kDragInventoryPickup) - g_allHotspots.activateOneHotspot(kInventoryDropSpotID); + _allHotspots.activateOneHotspot(kInventoryDropSpotID); else if (_dragType == kDragBiochipPickup) - g_allHotspots.activateOneHotspot(kBiochipDropSpotID); + _allHotspots.activateOneHotspot(kBiochipDropSpotID); else if (_dragType == kDragNoDrag) - g_allHotspots.activateMaskedHotspots(kShellSpotFlag); + _allHotspots.activateMaskedHotspots(kShellSpotFlag); } } diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h index 1ee0136c30..7f4fae5f11 100644 --- a/engines/pegasus/pegasus.h +++ b/engines/pegasus/pegasus.h @@ -112,6 +112,7 @@ public: uint getRandomNumber(uint max); void shuffleArray(int32 *arr, int32 count); void drawScaledFrame(const Graphics::Surface *frame, uint16 x, uint16 y); + HotspotList &getAllHotspots() { return _allHotspots; } // Energy void setLastEnergyValue(const int32 value) { _savedEnergyValue = value; } @@ -251,6 +252,7 @@ private: // Misc. Hotspot _returnHotspot; + HotspotList _allHotspots; InputHandler *_savedHandler; void showTempScreen(const Common::String &fileName); bool playMovieScaled(Video::VideoDecoder *video, uint16 x, uint16 y); |