diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/pet_control/pet_inventory_glyphs.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_inventory_glyphs.h | 7 |
2 files changed, 18 insertions, 7 deletions
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp index 734b260b0f..d19ea60408 100644 --- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp +++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp @@ -222,9 +222,12 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) { if (itemIndex == -1) return -1; + // Some objects can be in multiple different states. These are handled + // below to give each the correct inventory glyph and description switch (ITEM_MODES[itemIndex]) { case 0: - switch (subMode(item, isLoading)) { + // Maitre d'Bot's left arm + switch (getItemIndex(item, isLoading)) { case 0: case 1: return 0; @@ -236,7 +239,8 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) { } case 2: - switch (subMode(item, isLoading)) { + // Maitre d'Bot's right arm + switch (getItemIndex(item, isLoading)) { case 0: return 2; default: @@ -245,7 +249,8 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) { break; case 15: - switch (subMode(item, isLoading)) { + // Chicken + switch (getItemIndex(item, isLoading)) { case 0: case 1: return 14; @@ -263,7 +268,8 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) { break; case 26: - switch (subMode(item, isLoading)) { + // Beer glass + switch (getItemIndex(item, isLoading)) { case 0: return 26; case 1: @@ -284,14 +290,14 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) { return ITEM_MODES[itemIndex]; } -int CPetInventoryGlyph::subMode(CGameObject *item, bool isLoading) { +int CPetInventoryGlyph::getItemIndex(CGameObject *item, bool isLoading) { int frameNum = item->getFrameNumber(); int movieFrame = item->getMovieFrame(); if (isLoading && frameNum != -1 && frameNum != movieFrame) item->loadFrame(frameNum); - return frameNum; + return movieFrame; } void CPetInventoryGlyph::startBackgroundMovie() { diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h index e843cf53f9..cf1cfb392b 100644 --- a/engines/titanic/pet_control/pet_inventory_glyphs.h +++ b/engines/titanic/pet_control/pet_inventory_glyphs.h @@ -36,7 +36,12 @@ private: */ int populateItem(CGameObject *item, bool isLoading); - int subMode(CGameObject *item, bool isLoading); + /** + * For items which can have multiple different states, such as the + * beer glass or Maitre D arms, returns the correct item index to use + * for getting the inventory item glyph and description + */ + int getItemIndex(CGameObject *item, bool isLoading); /** * Start any movie for the background |