diff options
author | Paul Gilbert | 2016-09-02 22:44:34 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-09-02 22:44:34 -0400 |
commit | 9e437d46a8b95589263aa1185983d9c20d2f2879 (patch) | |
tree | ea62d71e1944837f7d86bbca501357c9139f30c7 /engines/titanic/pet_control | |
parent | e2c68e0a7dcb2eeb10072df84f1ac6dfefa8d1f1 (diff) | |
download | scummvm-rg350-9e437d46a8b95589263aa1185983d9c20d2f2879.tar.gz scummvm-rg350-9e437d46a8b95589263aa1185983d9c20d2f2879.tar.bz2 scummvm-rg350-9e437d46a8b95589263aa1185983d9c20d2f2879.zip |
TITANIC: Cleanup of CPetInventory, removal of unused fields
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r-- | engines/titanic/pet_control/pet_inventory.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_inventory.h | 3 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_inventory_glyphs.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_inventory_glyphs.h | 6 |
4 files changed, 17 insertions, 18 deletions
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp index 55176d8b0e..88310459c6 100644 --- a/engines/titanic/pet_control/pet_inventory.cpp +++ b/engines/titanic/pet_control/pet_inventory.cpp @@ -28,7 +28,7 @@ namespace Titanic { CPetInventory::CPetInventory() : CPetSection(), - _movie(nullptr), _field290(false), _field294(0), _field298(0) { + _movie(nullptr), _isLoading(false), _field298(0) { for (int idx = 0; idx < TOTAL_ITEMS; ++idx) { _itemBackgrounds[idx] = _itemGlyphs[idx] = nullptr; } @@ -109,9 +109,9 @@ void CPetInventory::load(SimpleFile *file, int param) { void CPetInventory::postLoad() { reset(); - _field290 = 1; + _isLoading = true; itemsChanged(); - _field290 = 0; + _isLoading = false; } void CPetInventory::save(SimpleFile *file, int indent) { @@ -179,7 +179,7 @@ void CPetInventory::itemsChanged() { while (item) { CPetInventoryGlyph *glyph = new CPetInventoryGlyph(); glyph->setup(_petControl, &_items); - glyph->setItem(item, _field290); + glyph->setItem(item, _isLoading); _items.push_back(glyph); item = _petControl->getNextObject(item); diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h index 17649546ce..184bb20385 100644 --- a/engines/titanic/pet_control/pet_inventory.h +++ b/engines/titanic/pet_control/pet_inventory.h @@ -40,8 +40,7 @@ private: CGameObject *_itemBackgrounds[46]; CGameObject *_itemGlyphs[46]; CGameObject *_movie; - bool _field290; - int _field294; + bool _isLoading; int _field298; private: /** diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp index 783a8a9717..38974547f5 100644 --- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp +++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp @@ -198,17 +198,17 @@ bool CPetInventoryGlyph::doAction(CGlyphAction *action) { return true; } -void CPetInventoryGlyph::setItem(CGameObject *item, int val) { +void CPetInventoryGlyph::setItem(CGameObject *item, bool isLoading) { _item = item; if (_owner && item) { - int v1 = populateItem(item, val); + int v1 = populateItem(item, isLoading); _background = dynamic_cast<CPetInventoryGlyphs *>(_owner)->getBackground(v1); _image = dynamic_cast<CPetInventory *>(getPetSection())->getImage(v1); } } -int CPetInventoryGlyph::populateItem(CGameObject *item, int val) { +int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) { // Scan the master item names list CString itemName = item->getName(); int itemIndex = -1; @@ -221,7 +221,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) { switch (ITEM_MODES[itemIndex]) { case 0: - switch (subMode(item, val)) { + switch (subMode(item, isLoading)) { case 0: case 1: return 0; @@ -233,7 +233,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) { } case 2: - switch (subMode(item, val)) { + switch (subMode(item, isLoading)) { case 0: return 2; default: @@ -242,7 +242,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) { break; case 15: - switch (subMode(item, val)) { + switch (subMode(item, isLoading)) { case 0: case 1: return 14; @@ -260,7 +260,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) { break; case 26: - switch (subMode(item, val)) { + switch (subMode(item, isLoading)) { case 0: return 26; case 1: @@ -281,11 +281,11 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) { return ITEM_MODES[itemIndex]; } -int CPetInventoryGlyph::subMode(CGameObject *item, int val) { +int CPetInventoryGlyph::subMode(CGameObject *item, bool isLoading) { int frameNum = item->getFrameNumber(); int movieFrame = item->getMovieFrame(); - if (val && frameNum != -1 && frameNum != movieFrame) + if (isLoading && frameNum != -1 && frameNum != movieFrame) item->loadFrame(frameNum); return frameNum; diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h index 716c9d1ad1..0d167c4c98 100644 --- a/engines/titanic/pet_control/pet_inventory_glyphs.h +++ b/engines/titanic/pet_control/pet_inventory_glyphs.h @@ -34,9 +34,9 @@ private: /** * Populate the details for an item */ - int populateItem(CGameObject *item, int val); + int populateItem(CGameObject *item, bool isLoading); - int subMode(CGameObject *item, int val); + int subMode(CGameObject *item, bool isLoading); /** * Start any movie for the background @@ -126,7 +126,7 @@ public: /** * Set the inventory item */ - void setItem(CGameObject *item, int val); + void setItem(CGameObject *item, bool isLoading); }; class CInventoryGlyphAction : public CGlyphAction { |