diff options
author | Colin Snover | 2017-02-16 22:28:55 -0600 |
---|---|---|
committer | Colin Snover | 2017-04-23 13:07:25 -0500 |
commit | c88a43b6156ad65d18bf2bc5ac7b8966eb616b18 (patch) | |
tree | 9b220d5ae980a9d1c5eb2a65c699be7c4fd057cb /engines/sci/graphics | |
parent | 0655cc13e698f64f1c2cef8166a855a0b619a88f (diff) | |
download | scummvm-rg350-c88a43b6156ad65d18bf2bc5ac7b8966eb616b18.tar.gz scummvm-rg350-c88a43b6156ad65d18bf2bc5ac7b8966eb616b18.tar.bz2 scummvm-rg350-c88a43b6156ad65d18bf2bc5ac7b8966eb616b18.zip |
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.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/screen_item32.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
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) { |