diff options
-rw-r--r-- | engines/parallaction/callables.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/location.cpp | 13 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 13 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 2 | ||||
-rw-r--r-- | engines/parallaction/saveload.cpp | 10 |
5 files changed, 9 insertions, 33 deletions
diff --git a/engines/parallaction/callables.cpp b/engines/parallaction/callables.cpp index 5d0b8979c3..570e1c0ea3 100644 --- a/engines/parallaction/callables.cpp +++ b/engines/parallaction/callables.cpp @@ -413,12 +413,10 @@ void _c_finito(void *parm) { // TODO (LIST): this sequence should be just _zones.clear() _vm->freeZones(_vm->_zones._next); - freeNodeList(_vm->_zones._next); _vm->_zones._next = NULL; // TODO (LIST): this sequence should be just _animations.clear() - _vm->freeZones(_vm->_animations._next); - freeNodeList(_vm->_animations._next); + _vm->freeAnimations(); _vm->_animations._next = NULL; // this dangerous flag can now be cleared diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp index 3c3aaab540..a59c2bbd26 100644 --- a/engines/parallaction/location.cpp +++ b/engines/parallaction/location.cpp @@ -195,22 +195,13 @@ void Parallaction::freeLocation() { // but that'll pretty meaningless with a single list approach. helperNode._prev = helperNode._next = NULL; freeZones(_zones._next); - freeNodeList(_zones._next); _zones._next = helperNode._next; _zones._prev = helperNode._prev; -// memcpy(&_zones, &helperNode, sizeof(Node)); debugC(7, kDebugLocation, "freeLocation: zones freed"); - // TODO (LIST): helperNode should be rendered useless by the use of a Common::List<> - // to store Zones and Animations. Right now, it holds a list of Zones to be preserved - // but that'll pretty meaningless with a single list approach. - helperNode._prev = helperNode._next = NULL; - freeZones(_animations._next); freeAnimations(); - freeNodeList(_animations._next); - _animations._next = helperNode._next; - _animations._prev = helperNode._prev; -// memcpy(&_animations, &helperNode, sizeof(Node)); + _animations._next = 0; + _animations._prev = 0; debugC(7, kDebugLocation, "freeLocation: animations freed"); if (_location._comment) { diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 9aa5e1e3fe..fc0399f853 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -805,19 +805,6 @@ void Parallaction::changeCharacter(const char *name) { return; } -// TODO (LIST): this rouinte basically performs List<>::clear() -// so it will become useless -void freeNodeList(Node *list) { - - while (list) { - Node *v4 = list->_next; - free(list); - list = v4; - } - - return; -} - // TODO (LIST): this routine will be removed void addNode(Node *list, Node *n) { diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 796bbbc65c..5ac53c932f 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -199,7 +199,7 @@ void waitUntilLeftClick(); void addNode(Node *list, Node *n); void removeNode(Node *n); -void freeNodeList(Node *list); + diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 5ad54adeea..284ac9402c 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -81,14 +81,14 @@ void Parallaction::doLoadGame(uint16 slot) { f->readLine(s, 15); - // TODO (LIST): the very same code can be found in _c_finito(). - // Why aren't we clearing Animations too, anyway? + // TODO (LIST): unify (and parametrize) calls to freeZones. + // We aren't calling freeAnimations because it is not needed, since + // kChangeLocation will trigger a complete deletion. Anyway, we still + // need to invoke freeZones here with kEngineQuit set, because the + // call in changeLocation preserve certain zones. _engineFlags |= kEngineQuit; - freeZones(_zones._next); - freeNodeList(_zones._next); _zones._next = NULL; - _engineFlags &= ~kEngineQuit; _numLocations = atoi(s); |