diff options
-rw-r--r-- | engines/cge2/hero.cpp | 13 | ||||
-rw-r--r-- | engines/cge2/hero.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/cge2/hero.cpp b/engines/cge2/hero.cpp index 0a72178fe7..cebfe73295 100644 --- a/engines/cge2/hero.cpp +++ b/engines/cge2/hero.cpp @@ -207,6 +207,19 @@ Sprite *Hero::expand() { // It's very similar to Sprite's expand, but doesn't bo return this; } +Sprite *Hero::contract() { + for (int i = 0; i < kDimMax; i++) { + if (_dim[i] != nullptr) { + delete[] _dim[i]; + if (_ext->_shpList == _dim[i]) + _ext->_shpList = nullptr; + _dim[i] = nullptr; + } + } + Sprite::contract(); + return this; +} + void Hero::setCurrent() { FXP m = _vm->_eye->_z / (_pos3D._z - _vm->_eye->_z); FXP tmp = m * _siz.y; diff --git a/engines/cge2/hero.h b/engines/cge2/hero.h index e8cce711f4..c277b4a780 100644 --- a/engines/cge2/hero.h +++ b/engines/cge2/hero.h @@ -77,6 +77,7 @@ public: Hero(CGE2Engine *vm); void tick(); Sprite *expand(); + Sprite *contract(); Sprite *setContact(); int stepSize() { return _ext->_seq[7]._dx; } int distance(V3D pos); |