From 33737ea2dcd97026706dd75f8c2c27fa148c165a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 1 Sep 2016 19:10:36 -0400 Subject: TITANIC: Convert many static_casts to dynamic_cast --- engines/titanic/pet_control/pet_inventory_glyphs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/titanic/pet_control/pet_inventory_glyphs.cpp') 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(action); - CPetInventoryGlyphs *owner = static_cast(_owner); + CPetInventoryGlyphs *owner = dynamic_cast(_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(_owner)->getBackground(v1); - _image = static_cast(getPetSection())->getImage(v1); + _background = dynamic_cast(_owner)->getBackground(v1); + _image = dynamic_cast(getPetSection())->getImage(v1); } } @@ -293,7 +293,7 @@ int CPetInventoryGlyph::subMode(CGameObject *item, int val) { void CPetInventoryGlyph::startBackgroundMovie() { if (_owner) { - CPetInventory *section = static_cast(_owner->getOwner()); + CPetInventory *section = dynamic_cast(_owner->getOwner()); if (section) section->playMovie(_background, 1); } @@ -301,7 +301,7 @@ void CPetInventoryGlyph::startBackgroundMovie() { void CPetInventoryGlyph::startForegroundMovie() { if (_owner) { - CPetInventory *section = static_cast(_owner->getOwner()); + CPetInventory *section = dynamic_cast(_owner->getOwner()); if (section) section->playMovie(_image, 1); } @@ -309,7 +309,7 @@ void CPetInventoryGlyph::startForegroundMovie() { void CPetInventoryGlyph::stopMovie() { if (_owner) { - CPetInventory *section = static_cast(_owner->getOwner()); + CPetInventory *section = dynamic_cast(_owner->getOwner()); if (section) section->playMovie(nullptr, 1); } -- cgit v1.2.3