diff options
author | Paul Gilbert | 2016-09-01 19:10:36 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-09-01 19:10:36 -0400 |
commit | 33737ea2dcd97026706dd75f8c2c27fa148c165a (patch) | |
tree | 29784cf3e7c9270b02a67f0fe02829d3bab9bbd2 /engines/titanic/pet_control/pet_inventory_glyphs.cpp | |
parent | ac740c8e39113f0cd50def490dba1c6d51e07e99 (diff) | |
download | scummvm-rg350-33737ea2dcd97026706dd75f8c2c27fa148c165a.tar.gz scummvm-rg350-33737ea2dcd97026706dd75f8c2c27fa148c165a.tar.bz2 scummvm-rg350-33737ea2dcd97026706dd75f8c2c27fa148c165a.zip |
TITANIC: Convert many static_casts to dynamic_cast
Diffstat (limited to 'engines/titanic/pet_control/pet_inventory_glyphs.cpp')
-rw-r--r-- | engines/titanic/pet_control/pet_inventory_glyphs.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp index ae306649a2..783a8a9717 100644 --- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp +++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp @@ -165,7 +165,7 @@ void CPetInventoryGlyph::getTooltip(CPetText *text) { bool CPetInventoryGlyph::doAction(CGlyphAction *action) { CInventoryGlyphAction *invAction = static_cast<CInventoryGlyphAction *>(action); - CPetInventoryGlyphs *owner = static_cast<CPetInventoryGlyphs *>(_owner); + CPetInventoryGlyphs *owner = dynamic_cast<CPetInventoryGlyphs *>(_owner); if (!invAction) return false; @@ -203,8 +203,8 @@ void CPetInventoryGlyph::setItem(CGameObject *item, int val) { if (_owner && item) { int v1 = populateItem(item, val); - _background = static_cast<CPetInventoryGlyphs *>(_owner)->getBackground(v1); - _image = static_cast<CPetInventory *>(getPetSection())->getImage(v1); + _background = dynamic_cast<CPetInventoryGlyphs *>(_owner)->getBackground(v1); + _image = dynamic_cast<CPetInventory *>(getPetSection())->getImage(v1); } } @@ -293,7 +293,7 @@ int CPetInventoryGlyph::subMode(CGameObject *item, int val) { void CPetInventoryGlyph::startBackgroundMovie() { if (_owner) { - CPetInventory *section = static_cast<CPetInventory *>(_owner->getOwner()); + CPetInventory *section = dynamic_cast<CPetInventory *>(_owner->getOwner()); if (section) section->playMovie(_background, 1); } @@ -301,7 +301,7 @@ void CPetInventoryGlyph::startBackgroundMovie() { void CPetInventoryGlyph::startForegroundMovie() { if (_owner) { - CPetInventory *section = static_cast<CPetInventory *>(_owner->getOwner()); + CPetInventory *section = dynamic_cast<CPetInventory *>(_owner->getOwner()); if (section) section->playMovie(_image, 1); } @@ -309,7 +309,7 @@ void CPetInventoryGlyph::startForegroundMovie() { void CPetInventoryGlyph::stopMovie() { if (_owner) { - CPetInventory *section = static_cast<CPetInventory *>(_owner->getOwner()); + CPetInventory *section = dynamic_cast<CPetInventory *>(_owner->getOwner()); if (section) section->playMovie(nullptr, 1); } |