aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/pegasus.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2012-08-28 16:50:15 -0400
committerMatthew Hoops2012-08-28 16:50:15 -0400
commitf61146f32791831211c7b9399ec681aed109f03b (patch)
tree7aa7e8d749448f06427cce963ba088e2f9d71716 /engines/pegasus/pegasus.cpp
parent81e7c9a0c1599786a1aeb73d243609a2d280335f (diff)
downloadscummvm-rg350-f61146f32791831211c7b9399ec681aed109f03b.tar.gz
scummvm-rg350-f61146f32791831211c7b9399ec681aed109f03b.tar.bz2
scummvm-rg350-f61146f32791831211c7b9399ec681aed109f03b.zip
PEGASUS: Remove g_allItems global construction
Diffstat (limited to 'engines/pegasus/pegasus.cpp')
-rw-r--r--engines/pegasus/pegasus.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index ad0abc2186..efa57d586f 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -470,14 +470,14 @@ bool PegasusEngine::loadFromStream(Common::ReadStream *stream) {
setEnergyDeathReason(stream->readByte());
// Items
- g_allItems.readFromStream(stream);
+ _allItems.readFromStream(stream);
// Inventory
byte itemCount = stream->readByte();
if (itemCount > 0) {
for (byte i = 0; i < itemCount; i++) {
- InventoryItem *inv = (InventoryItem *)g_allItems.findItemByID((ItemID)stream->readUint16BE());
+ InventoryItem *inv = (InventoryItem *)_allItems.findItemByID((ItemID)stream->readUint16BE());
addItemToInventory(inv);
}
@@ -489,7 +489,7 @@ bool PegasusEngine::loadFromStream(Common::ReadStream *stream) {
if (biochipCount > 0) {
for (byte i = 0; i < biochipCount; i++) {
- BiochipItem *biochip = (BiochipItem *)g_allItems.findItemByID((ItemID)stream->readUint16BE());
+ BiochipItem *biochip = (BiochipItem *)_allItems.findItemByID((ItemID)stream->readUint16BE());
addItemToBiochips(biochip);
}
@@ -541,7 +541,7 @@ bool PegasusEngine::writeToStream(Common::WriteStream *stream, int saveType) {
stream->writeByte(getEnergyDeathReason());
// Items
- g_allItems.writeToStream(stream);
+ _allItems.writeToStream(stream);
// Inventory
byte itemCount = _items.getNumItems();
@@ -1392,7 +1392,7 @@ bool PegasusEngine::itemInLocation(const ItemID itemID, const NeighborhoodID nei
RoomID itemRoom;
DirectionConstant itemDirection;
- Item *item = g_allItems.findItemByID(itemID);
+ Item *item = _allItems.findItemByID(itemID);
item->getItemRoom(itemNeighborhood, itemRoom, itemDirection);
return itemNeighborhood == neighborhood && itemRoom == room && itemDirection == direction;
@@ -1503,17 +1503,17 @@ void PegasusEngine::startNewGame() {
removeAllItemsFromInventory();
removeAllItemsFromBiochips();
- BiochipItem *biochip = (BiochipItem *)g_allItems.findItemByID(kAIBiochip);
+ BiochipItem *biochip = (BiochipItem *)_allItems.findItemByID(kAIBiochip);
addItemToBiochips(biochip);
if (isDemo()) {
- biochip = (BiochipItem *)g_allItems.findItemByID(kPegasusBiochip);
+ biochip = (BiochipItem *)_allItems.findItemByID(kPegasusBiochip);
addItemToBiochips(biochip);
- biochip = (BiochipItem *)g_allItems.findItemByID(kMapBiochip);
+ biochip = (BiochipItem *)_allItems.findItemByID(kMapBiochip);
addItemToBiochips(biochip);
- InventoryItem *item = (InventoryItem *)g_allItems.findItemByID(kKeyCard);
+ InventoryItem *item = (InventoryItem *)_allItems.findItemByID(kKeyCard);
addItemToInventory(item);
- item = (InventoryItem *)g_allItems.findItemByID(kJourneymanKey);
+ item = (InventoryItem *)_allItems.findItemByID(kJourneymanKey);
addItemToInventory(item);
_currentItemID = kJourneymanKey;
} else {
@@ -2154,7 +2154,7 @@ void PegasusEngine::drawScaledFrame(const Graphics::Surface *frame, uint16 x, ui
}
void PegasusEngine::destroyInventoryItem(const ItemID itemID) {
- InventoryItem *item = (InventoryItem *)g_allItems.findItemByID(itemID);
+ InventoryItem *item = (InventoryItem *)_allItems.findItemByID(itemID);
ItemExtraEntry entry;