From c88a43b6156ad65d18bf2bc5ac7b8966eb616b18 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 16 Feb 2017 22:28:55 -0600 Subject: SCI32: Reset ScreenItem cel type when updating from a VM object In Phant2, when going to email on Curtis's office computer, a screen item that contained a bitmap on the last frame was updated to contain a view on the next frame. This crashed the engine when it tried to reuse the old disposed bitmap instead of the new view because the cel type was never changed from kCelTypeMem to kCelTypeView. --- engines/sci/graphics/screen_item32.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'engines/sci/graphics/screen_item32.cpp') diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp index 77ff9a3d75..d184485aa6 100644 --- a/engines/sci/graphics/screen_item32.cpp +++ b/engines/sci/graphics/screen_item32.cpp @@ -212,15 +212,13 @@ void ScreenItem::setFromObject(SegManager *segMan, const reg_t object, const boo } } - if (updateBitmap) { - const reg_t bitmap = readSelector(segMan, object, SELECTOR(bitmap)); - if (!bitmap.isNull()) { - _celInfo.bitmap = bitmap; - _celInfo.type = kCelTypeMem; - } else { - _celInfo.bitmap = NULL_REG; - _celInfo.type = kCelTypeView; - } + const reg_t bitmap = readSelector(segMan, object, SELECTOR(bitmap)); + if (updateBitmap && !bitmap.isNull()) { + _celInfo.bitmap = bitmap; + _celInfo.type = kCelTypeMem; + } else { + _celInfo.bitmap = NULL_REG; + _celInfo.type = kCelTypeView; } if (updateCel || updateBitmap) { -- cgit v1.2.3