diff options
author | Paul Gilbert | 2017-01-15 16:21:46 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-01-15 16:21:46 -0500 |
commit | 988e47d2d0ec0b803dbd20b7018b792952ac9b3a (patch) | |
tree | 25e0f232f1a7b6e4bcd061525d7e1ccda1f30991 /engines/titanic/pet_control | |
parent | 85a6c1d3fe4ca4297867bfc1ac51ca90a71f0753 (diff) | |
download | scummvm-rg350-988e47d2d0ec0b803dbd20b7018b792952ac9b3a.tar.gz scummvm-rg350-988e47d2d0ec0b803dbd20b7018b792952ac9b3a.tar.bz2 scummvm-rg350-988e47d2d0ec0b803dbd20b7018b792952ac9b3a.zip |
TITANIC: Show correct inventory glyphs & tooltip for multi-state items
Diffstat (limited to 'engines/titanic/pet_control')
-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 |