From 08821cf4e3cec6d8b65b4cb1fa49f466430eb330 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Mon, 11 Jul 2016 09:08:00 -0500 Subject: SCI32: Give planes a default type With the addition of the transparent pic type code, the _type property would be read uninitialised by setType if _pictureId was set to kPlanePic. CID 1357230, 1357231. --- engines/sci/graphics/plane32.cpp | 3 +++ engines/sci/graphics/plane32.h | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/engines/sci/graphics/plane32.cpp b/engines/sci/graphics/plane32.cpp index 87ab43bb5c..aa629e4081 100644 --- a/engines/sci/graphics/plane32.cpp +++ b/engines/sci/graphics/plane32.cpp @@ -47,6 +47,7 @@ uint16 Plane::_nextObjectId = 20000; Plane::Plane(const Common::Rect &gameRect, PlanePictureCodes pictureId) : _pictureId(pictureId), _mirrored(false), +_type(kPlaneTypeColored), _back(0), _priorityChanged(0), _object(make_reg(0, _nextObjectId++)), @@ -63,6 +64,7 @@ _gameRect(gameRect) { } Plane::Plane(reg_t object) : +_type(kPlaneTypeColored), _priorityChanged(false), _object(object), _redrawAllCount(g_sci->_gfxFrameout->getScreenCount()), @@ -93,6 +95,7 @@ _moved(0) { Plane::Plane(const Plane &other) : _pictureId(other._pictureId), _mirrored(other._mirrored), +_type(other._type), _back(other._back), _object(other._object), _priority(other._priority), diff --git a/engines/sci/graphics/plane32.h b/engines/sci/graphics/plane32.h index a1739264e8..3981a2b319 100644 --- a/engines/sci/graphics/plane32.h +++ b/engines/sci/graphics/plane32.h @@ -149,6 +149,11 @@ private: void setType(); public: + /** + * The type of the plane. + */ + PlaneType _type; + /** * The color to use when erasing the plane. Only * applies to planes of type kPlaneTypeColored. @@ -186,8 +191,6 @@ public: */ int _redrawAllCount; - PlaneType _type; - /** * Flags indicating the state of the plane. * - `created` is set when the plane is first created, -- cgit v1.2.3