diff options
author | Paul Gilbert | 2011-03-08 19:19:36 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-03-08 19:19:36 +1100 |
commit | ba94342f6f7a1728d8794faa1b429491ba2e0ec2 (patch) | |
tree | 57221f0577f5efbc84453341817554d988ee56ec /engines/tsage | |
parent | b0dfe962e6ea18f9bff5ad4b48226f729cf6d84b (diff) | |
download | scummvm-rg350-ba94342f6f7a1728d8794faa1b429491ba2e0ec2.tar.gz scummvm-rg350-ba94342f6f7a1728d8794faa1b429491ba2e0ec2.tar.bz2 scummvm-rg350-ba94342f6f7a1728d8794faa1b429491ba2e0ec2.zip |
TSAGE: Bugfix to increment data block lock counter when a Visage is cloned
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/core.cpp | 18 | ||||
-rw-r--r-- | engines/tsage/core.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 4b27e77687..38d21d98be 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2465,6 +2465,24 @@ Visage::Visage() { _data = NULL; } +Visage::Visage(const Visage &v) { + _resNum = v._resNum; + _rlbNum = v._rlbNum; + _data = v._data; + if (_data) + _vm->_memoryManager.incLocks(_data); +} + +Visage &Visage::operator=(const Visage &s) { + _resNum = s._resNum; + _rlbNum = s._rlbNum; + _data = s._data; + if (_data) + _vm->_memoryManager.incLocks(_data); + + return *this; +} + void Visage::setVisage(int resNum, int rlbNum) { if ((_resNum != resNum) || (_rlbNum != rlbNum)) { _resNum = resNum; diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 09f648a811..148b44874d 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -433,11 +433,13 @@ public: int _rlbNum; public: Visage(); + Visage(const Visage &v); ~Visage(); void setVisage(int resNum, int rlbNum = 9999); GfxSurface getFrame(int frameNum); int getFrameCount() const; + Visage &operator=(const Visage &s); }; class SceneObjectWrapper: public EventHandler { |