From f61146f32791831211c7b9399ec681aed109f03b Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 28 Aug 2012 16:50:15 -0400 Subject: PEGASUS: Remove g_allItems global construction --- engines/pegasus/neighborhood/caldoria/caldoria.cpp | 8 ++++---- engines/pegasus/neighborhood/mars/mars.cpp | 8 ++++---- engines/pegasus/neighborhood/neighborhood.cpp | 4 ++-- engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp | 8 ++++---- engines/pegasus/neighborhood/norad/delta/noraddelta.cpp | 2 +- engines/pegasus/neighborhood/prehistoric/prehistoric.cpp | 10 +++++----- engines/pegasus/neighborhood/tsa/fulltsa.cpp | 4 ++-- engines/pegasus/neighborhood/wsc/wsc.cpp | 16 ++++++++-------- 8 files changed, 30 insertions(+), 30 deletions(-) (limited to 'engines/pegasus/neighborhood') diff --git a/engines/pegasus/neighborhood/caldoria/caldoria.cpp b/engines/pegasus/neighborhood/caldoria/caldoria.cpp index 6421195c8e..8c31debf1c 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoria.cpp +++ b/engines/pegasus/neighborhood/caldoria/caldoria.cpp @@ -1175,7 +1175,7 @@ void Caldoria::receiveNotification(Notification *notification, const Notificatio arriveAt(kCaldoria27, GameState.getCurrentDirection()); break; case kCaGTCardSwipe: - item = (InventoryItem *)g_allItems.findItemByID(kKeyCard); + item = (InventoryItem *)_vm->getAllItems().findItemByID(kKeyCard); _vm->addItemToInventory(item); setCurrentActivation(kActivateReadyToTransport); break; @@ -1212,7 +1212,7 @@ void Caldoria::receiveNotification(Notification *notification, const Notificatio } break; case kCa53EastShootSinclair: - _vm->addItemToInventory((InventoryItem *)g_allItems.findItemByID(kStunGun)); + _vm->addItemToInventory((InventoryItem *)_vm->getAllItems().findItemByID(kStunGun)); startExtraSequence(kCa53EastZoomOutFromSinclair, kExtraCompletedFlag, false); GameState.setScoringStunnedSinclair(true); break; @@ -1769,8 +1769,8 @@ void Caldoria::openElevatorMovie() { void Caldoria::emptyOJGlass() { GameState.setTakenItemID(kOrangeJuiceGlassFull, false); GameState.setTakenItemID(kOrangeJuiceGlassEmpty, true); - _vm->removeItemFromInventory((InventoryItem *)g_allItems.findItemByID(kOrangeJuiceGlassFull)); - _vm->addItemToInventory((InventoryItem *)g_allItems.findItemByID(kOrangeJuiceGlassEmpty)); + _vm->removeItemFromInventory((InventoryItem *)_vm->getAllItems().findItemByID(kOrangeJuiceGlassFull)); + _vm->addItemToInventory((InventoryItem *)_vm->getAllItems().findItemByID(kOrangeJuiceGlassEmpty)); } void Caldoria::doorBombTimerExpired() { diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp index 8c1098a73d..9cc8ab63d4 100644 --- a/engines/pegasus/neighborhood/mars/mars.cpp +++ b/engines/pegasus/neighborhood/mars/mars.cpp @@ -1632,7 +1632,7 @@ void Mars::activateHotspots() { case MakeRoomView(kMars56, kEast): switch (getCurrentActivation()) { case kActivateReactorReadyForNitrogen: - item = (InventoryItem *)g_allItems.findItemByID(kNitrogenCanister); + item = (InventoryItem *)_vm->getAllItems().findItemByID(kNitrogenCanister); if (item->getItemState() != kNitrogenFull) _vm->getAllHotspots().deactivateOneHotspot(kMars57DropNitrogenSpotID); // Fall through... @@ -2151,7 +2151,7 @@ void Mars::receiveNotification(Notification *notification, const NotificationFla } break; case kMarsTurnOnPod: - item = (InventoryItem *)g_allItems.findItemByID(kMarsCard); + item = (InventoryItem *)_vm->getAllItems().findItemByID(kMarsCard); _vm->addItemToInventory(item); GameState.setScoringTurnedOnTransport(); loadLoopSound1(""); @@ -2259,7 +2259,7 @@ void Mars::receiveNotification(Notification *notification, const NotificationFla GameState.setMarsLockFrozen(false); break; case kMars57FreezeLock: - item = (InventoryItem *)g_allItems.findItemByID(kNitrogenCanister); + item = (InventoryItem *)_vm->getAllItems().findItemByID(kNitrogenCanister); item->setItemState(kNitrogenEmpty); _vm->addItemToInventory(item); setCurrentActivation(kActivateReactorReadyForCrowBar); @@ -2271,7 +2271,7 @@ void Mars::receiveNotification(Notification *notification, const NotificationFla _utilityFuse.lightFuse(); break; case kMars57BreakLock: - item = (InventoryItem *)g_allItems.findItemByID(kCrowbar); + item = (InventoryItem *)_vm->getAllItems().findItemByID(kCrowbar); _vm->addItemToInventory(item); GameState.setScoringUsedCrowBar(); GameState.setMarsLockBroken(true); diff --git a/engines/pegasus/neighborhood/neighborhood.cpp b/engines/pegasus/neighborhood/neighborhood.cpp index a93dd7e0a7..bb2c6486cc 100644 --- a/engines/pegasus/neighborhood/neighborhood.cpp +++ b/engines/pegasus/neighborhood/neighborhood.cpp @@ -676,7 +676,7 @@ void Neighborhood::clickInHotspot(const Input &input, const Hotspot *clickedSpot } if (itemID != kNoItemID) { - Item *draggingItem = g_allItems.findItemByID(itemID); + Item *draggingItem = _vm->getAllItems().findItemByID(itemID); if (draggingItem) { takeItemFromRoom(draggingItem); @@ -1157,7 +1157,7 @@ void Neighborhood::activateOneHotspot(HotspotInfoTable::Entry &entry, Hotspot *h break; default: if ((hotspot->getHotspotFlags() & kPickUpBiochipSpotFlag) != 0) { - Item *item = g_allItems.findItemByID(entry.hotspotItem); + Item *item = _vm->getAllItems().findItemByID(entry.hotspotItem); if (item && item->getItemNeighborhood() == getObjectID()) hotspot->setActive(); } else { diff --git a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp index 2d050d9aa5..793d8ffb59 100644 --- a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp +++ b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp @@ -136,25 +136,25 @@ void NoradAlpha::start() { RoomID itemRoom; DirectionConstant itemDirection; - Item *item = (Item *)g_allItems.findItemByID(kGasCanister); + Item *item = (Item *)_vm->getAllItems().findItemByID(kGasCanister); item->getItemRoom(itemNeighborhood, itemRoom, itemDirection); if (itemNeighborhood == getObjectID()) { _fillingStationItem = item; } else { - item = (Item *)g_allItems.findItemByID(kAirMask); + item = (Item *)_vm->getAllItems().findItemByID(kAirMask); item->getItemRoom(itemNeighborhood, itemRoom, itemDirection); if (itemNeighborhood == getObjectID()) { _fillingStationItem = item; } else { - item = (Item *)g_allItems.findItemByID(kNitrogenCanister); + item = (Item *)_vm->getAllItems().findItemByID(kNitrogenCanister); item->getItemRoom(itemNeighborhood, itemRoom, itemDirection); if (itemNeighborhood == getObjectID()) { _fillingStationItem = item; } else { - item = (Item *)g_allItems.findItemByID(kArgonCanister); + item = (Item *)_vm->getAllItems().findItemByID(kArgonCanister); item->getItemRoom(itemNeighborhood, itemRoom, itemDirection); if (itemNeighborhood == getObjectID()) _fillingStationItem = item; diff --git a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp index cf21f7744f..01530023c8 100644 --- a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp +++ b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp @@ -846,7 +846,7 @@ void NoradDelta::doSolve() { if (GameState.getCurrentRoomAndView() == MakeRoomView(kNorad68, kWest)) { if (!_vm->playerHasItemID(kRetinalScanBiochip)) - _vm->addItemToBiochips((BiochipItem *)g_allItems.findItemByID(kRetinalScanBiochip)); + _vm->addItemToBiochips((BiochipItem *)_vm->getAllItems().findItemByID(kRetinalScanBiochip)); BiochipItem *biochip = _vm->getCurrentBiochip(); if (biochip != 0 && biochip->getObjectID() != kRetinalScanBiochip && g_interface) diff --git a/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp b/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp index dcc00ab651..11e28f072d 100644 --- a/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp +++ b/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp @@ -284,7 +284,7 @@ void Prehistoric::turnTo(const DirectionConstant newDirection) { break; case MakeRoomView(kPrehistoric16, kNorth): case MakeRoomView(kPrehistoric21, kWest): - keyCard = g_allItems.findItemByID(kKeyCard); + keyCard = _vm->getAllItems().findItemByID(kKeyCard); if (keyCard->getItemState() == kFlashlightOff) { keyCard->setItemState(kFlashlightOn); playSpotSoundSync(kPrehistoricFlashlightClickIn, kPrehistoricFlashlightClickOut); @@ -294,7 +294,7 @@ void Prehistoric::turnTo(const DirectionConstant newDirection) { case MakeRoomView(kPrehistoric16, kWest): case MakeRoomView(kPrehistoric21, kNorth): case MakeRoomView(kPrehistoric21, kSouth): - keyCard = g_allItems.findItemByID(kKeyCard); + keyCard = _vm->getAllItems().findItemByID(kKeyCard); if (keyCard->getItemState() == kFlashlightOn) { keyCard->setItemState(kFlashlightOff); playSpotSoundSync(kPrehistoricFlashlightClickIn, kPrehistoricFlashlightClickOut); @@ -356,7 +356,7 @@ void Prehistoric::arriveAt(const RoomID room, const DirectionConstant direction) zoomToVault(); break; case MakeRoomView(kPrehistoric16, kNorth): - keyCard = g_allItems.findItemByID(kKeyCard); + keyCard = _vm->getAllItems().findItemByID(kKeyCard); if (keyCard->getItemState() == kFlashlightOff) { keyCard->setItemState(kFlashlightOn); @@ -383,7 +383,7 @@ void Prehistoric::arriveAt(const RoomID room, const DirectionConstant direction) case MakeRoomView(kPrehistoric19, kNorth): case MakeRoomView(kPrehistoric20, kNorth): case MakeRoomView(kPrehistoric21, kEast): - keyCard = g_allItems.findItemByID(kKeyCard); + keyCard = _vm->getAllItems().findItemByID(kKeyCard); if (keyCard->getItemState() == kFlashlightOn) { keyCard->setItemState(kFlashlightOff); @@ -554,7 +554,7 @@ void Prehistoric::receiveNotification(Notification *notification, const Notifica break; case kPre25EastUnlockingVaultNoLog: case kPre25EastUnlockingVaultWithLog: - _vm->addItemToInventory((InventoryItem *)g_allItems.findItemByID(kJourneymanKey)); + _vm->addItemToInventory((InventoryItem *)_vm->getAllItems().findItemByID(kJourneymanKey)); break; } } diff --git a/engines/pegasus/neighborhood/tsa/fulltsa.cpp b/engines/pegasus/neighborhood/tsa/fulltsa.cpp index bb7a701200..2269ea7122 100644 --- a/engines/pegasus/neighborhood/tsa/fulltsa.cpp +++ b/engines/pegasus/neighborhood/tsa/fulltsa.cpp @@ -1108,7 +1108,7 @@ void FullTSA::pickedUpItem(Item *item) { GameState.setScoringGotJourneymanKey(true); break; case kPegasusBiochip: - biochip = (BiochipItem *)g_allItems.findItemByID(kMapBiochip); + biochip = (BiochipItem *)_vm->getAllItems().findItemByID(kMapBiochip); _vm->addItemToBiochips(biochip); GameState.setScoringGotPegasusBiochip(true); break; @@ -2373,7 +2373,7 @@ void FullTSA::receiveNotification(Notification *notification, const Notification switch (lastExtra) { case kTSAGTCardSwipe: - item = (InventoryItem *)g_allItems.findItemByID(kKeyCard); + item = (InventoryItem *)_vm->getAllItems().findItemByID(kKeyCard); _vm->addItemToInventory(item); setCurrentActivation(kActivateTSAReadyToTransport); break; diff --git a/engines/pegasus/neighborhood/wsc/wsc.cpp b/engines/pegasus/neighborhood/wsc/wsc.cpp index 39fbe37648..e3a0eff01b 100644 --- a/engines/pegasus/neighborhood/wsc/wsc.cpp +++ b/engines/pegasus/neighborhood/wsc/wsc.cpp @@ -1098,7 +1098,7 @@ void WSC::closeDoorOffScreen(const RoomID room, const DirectionConstant) { case kWSC82: case kWSC92: case kWSC93: - keyCard = g_allItems.findItemByID(kKeyCard); + keyCard = _vm->getAllItems().findItemByID(kKeyCard); if (keyCard->getItemState() == kFlashlightOn && (GameState.getCurrentRoom() == kWSC81 || GameState.getCurrentRoom() == kWSC93)) { keyCard->setItemState(kFlashlightOff); @@ -1166,11 +1166,11 @@ void WSC::doorOpened() { switch (GameState.getCurrentRoomAndView()) { case MakeRoomView(kWSC42, kEast): - _vm->addItemToInventory((InventoryItem *)g_allItems.findItemByID(kSinclairKey)); + _vm->addItemToInventory((InventoryItem *)_vm->getAllItems().findItemByID(kSinclairKey)); break; case MakeRoomView(kWSC58, kSouth): GameState.setScoringUsedCrowBarInWSC(); - _vm->addItemToInventory((InventoryItem *)g_allItems.findItemByID(kCrowbar)); + _vm->addItemToInventory((InventoryItem *)_vm->getAllItems().findItemByID(kCrowbar)); break; case MakeRoomView(kWSC06, kNorth): case MakeRoomView(kWSC79, kWest): @@ -1663,7 +1663,7 @@ void WSC::receiveNotification(Notification *notification, const NotificationFlag makeContinuePoint(); break; case kWSCDartScan2: - _vm->addItemToInventory((InventoryItem *)g_allItems.findItemByID(kPoisonDart)); + _vm->addItemToInventory((InventoryItem *)_vm->getAllItems().findItemByID(kPoisonDart)); GameState.setScoringRemovedDart(); GameState.setWSCRemovedDart(true); setUpPoison(); @@ -1915,7 +1915,7 @@ void WSC::receiveNotification(Notification *notification, const NotificationFlag //g_AIArea->playAIMovie(kRightAreaSignature, "Images/AI/WSC/XN59WD", false, kWarningInterruption); break; case kW98RobotGassed: - item = (Item *)g_allItems.findItemByID(kArgonCanister); + item = (Item *)_vm->getAllItems().findItemByID(kArgonCanister); _vm->addItemToInventory((InventoryItem *)item); setCurrentActivation(kActivationRobotDead); GameState.setWSCRobotDead(true); @@ -2112,7 +2112,7 @@ void WSC::activateOneHotspot(HotspotInfoTable::Entry &entry, Hotspot *hotspot) { hotspot->setActive(); break; case kW98DropArgonSpotID: - argonCanister = g_allItems.findItemByID(kArgonCanister); + argonCanister = _vm->getAllItems().findItemByID(kArgonCanister); if (argonCanister->getItemState() != kArgonFull) hotspot->setInactive(); break; @@ -2342,9 +2342,9 @@ void WSC::pickedUpItem(Item *item) { break; case kArgonPickup: _vm->removeItemFromInventory((InventoryItem *)item); - item = (Item *)g_allItems.findItemByID(kArgonCanister); + item = (Item *)_vm->getAllItems().findItemByID(kArgonCanister); _vm->addItemToInventory((InventoryItem *)item); - item = (Item *)g_allItems.findItemByID(kSinclairKey); + item = (Item *)_vm->getAllItems().findItemByID(kSinclairKey); _vm->addItemToInventory((InventoryItem *)item); _vm->getAllHotspots().setHotspotRect(kWSC02SouthMorphOutSpotID, Common::Rect(kNavAreaLeft, kNavAreaTop, 512 + kNavAreaLeft, 256 + kNavAreaTop)); -- cgit v1.2.3