diff options
author | Colin Snover | 2016-07-11 09:08:00 -0500 |
---|---|---|
committer | Colin Snover | 2016-07-11 10:39:50 -0500 |
commit | 08821cf4e3cec6d8b65b4cb1fa49f466430eb330 (patch) | |
tree | 3445fe00989d5cb8070dfb77112e0cd8cbd17226 | |
parent | f171db965c2a927d8d526f56d777a70f6b89ed51 (diff) | |
download | scummvm-rg350-08821cf4e3cec6d8b65b4cb1fa49f466430eb330.tar.gz scummvm-rg350-08821cf4e3cec6d8b65b4cb1fa49f466430eb330.tar.bz2 scummvm-rg350-08821cf4e3cec6d8b65b4cb1fa49f466430eb330.zip |
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.
-rw-r--r-- | engines/sci/graphics/plane32.cpp | 3 | ||||
-rw-r--r-- | 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 @@ -150,6 +150,11 @@ private: 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, |