diff options
author | Colin Snover | 2017-11-16 12:05:14 -0600 |
---|---|---|
committer | Eugene Sandulenko | 2017-11-18 22:35:12 +0100 |
commit | 4cc64c4139903c9a6b769855ab2a8a8125beb644 (patch) | |
tree | 46c1076163f3dfa7bd913b2f39b7b0737487aa5c /engines/fullpipe/gfx.h | |
parent | a2e2569347794ee2c54bfac3b64076b481f50fd6 (diff) | |
download | scummvm-rg350-4cc64c4139903c9a6b769855ab2a8a8125beb644.tar.gz scummvm-rg350-4cc64c4139903c9a6b769855ab2a8a8125beb644.tar.bz2 scummvm-rg350-4cc64c4139903c9a6b769855ab2a8a8125beb644.zip |
FULLPIPE: Fix memory leaks in PictureObject, Background
Diffstat (limited to 'engines/fullpipe/gfx.h')
-rw-r--r-- | engines/fullpipe/gfx.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h index 252f855691..a7c0c765e2 100644 --- a/engines/fullpipe/gfx.h +++ b/engines/fullpipe/gfx.h @@ -167,17 +167,10 @@ class GameObject : public CObject { }; class PictureObject : public GameObject { - public: - Picture *_picture; - Common::Array<GameObject *> *_pictureObject2List; - int _ox2; - int _oy2; - - public: +public: PictureObject(); PictureObject(PictureObject *src); - virtual ~PictureObject(); virtual bool load(MfcArchive &file, bool bigPicture); virtual bool load(MfcArchive &file) { assert(0); return false; } // Disable base class @@ -190,10 +183,18 @@ class PictureObject : public GameObject { bool isPointInside(int x, int y); bool isPixelHitAtPos(int x, int y); void setOXY2(); + + Common::SharedPtr<Picture> _picture; + +private: + Common::Array<GameObject> _pictureObject2List; + int _ox2; + int _oy2; }; class Background : public CObject { - public: +public: + /** list items are owned */ Common::Array<PictureObject *> _picObjList; Common::String _bgname; @@ -201,18 +202,19 @@ class Background : public CObject { int _y; int16 _messageQueueId; Palette _palette; - int _bigPictureArray1Count; - int _bigPictureArray2Count; - BigPicture ***_bigPictureArray; + /** list items are owned */ + Common::Array<BigPicture *> _bigPictureArray; + uint _bigPictureXDim; + uint _bigPictureYDim; - public: +public: Background(); virtual ~Background(); virtual bool load(MfcArchive &file); void addPictureObject(PictureObject *pct); - BigPicture *getBigPicture(int x, int y) { return _bigPictureArray[x][y]; } + BigPicture *getBigPicture(int x, int y) { return _bigPictureArray[y * _bigPictureYDim + x]; } }; struct ShadowsItem { |