mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 22:58:09 +00:00
CGE2: Fix another probable memory-leak source.
This commit is contained in:
parent
10a37ea478
commit
be5ec466b3
@ -34,6 +34,10 @@ namespace CGE2 {
|
||||
Hero::Hero(CGE2Engine *vm)
|
||||
: Sprite(vm), _contact(nullptr), _dir(kNoDir),
|
||||
_curDim(0), _tracePtr(-1), _ignoreMap(false) {
|
||||
|
||||
for (int i = 0; i < kDimMax; i++) {
|
||||
_dim[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Sprite *Hero::expand() { // It's very similar to Sprite's expand, but doesn't bother with "labels" for example. TODO: Try to unify the two later!
|
||||
@ -210,6 +214,15 @@ 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];
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
void Hero::setCurrent() {
|
||||
FXP m = _vm->_eye->_z / (_pos3D._z - _vm->_eye->_z);
|
||||
FXP tmp = m * _siz.y;
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
Hero(CGE2Engine *vm);
|
||||
void tick();
|
||||
Sprite *expand();
|
||||
Sprite *contract() { return this; }
|
||||
Sprite *contract();
|
||||
Sprite *setContact();
|
||||
int stepSize() { return _ext->_seq[7]._dx; }
|
||||
int distance(V3D pos);
|
||||
|
Loading…
Reference in New Issue
Block a user