diff options
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 11 | ||||
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 38 |
2 files changed, 47 insertions, 2 deletions
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index c8b01939dd..0599295160 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -635,7 +635,16 @@ bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header) } void GameLoader::restoreDefPicAniInfos() { - warning("STUB: restoreDefPicAniInfos()"); + for (uint i = 0; i < _sc2array.size(); i++) { + if (_sc2array[i]._picAniInfos) { + free(_sc2array[i]._picAniInfos); + _sc2array[i]._picAniInfos = 0; + _sc2array[i]._picAniInfosCount = 0; + } + + if (_sc2array[i]._scene) + applyPicAniInfos(_sc2array[i]._scene, _sc2array[i]._defPicAniInfos, _sc2array[i]._defPicAniInfosCount); + } } GameVar *FullpipeEngine::getGameLoaderGameVar() { diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 41641457d3..141196c7d7 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -162,7 +162,43 @@ GameVar::GameVar() { } GameVar::~GameVar() { - warning("STUB: GameVar::~GameVar()"); + if (_varType == 2) + free(_value.stringValue); + + if (_parentVarObj && !_prevVarObj ) { + if (_parentVarObj->_subVars == this) { + _parentVarObj->_subVars = _nextVarObj; + } else if (_parentVarObj->_field_14 == this) { + _parentVarObj->_field_14 = _nextVarObj; + } else { + _parentVarObj = 0; + } + } + + if (_prevVarObj) + _prevVarObj->_nextVarObj = _nextVarObj; + + if (_nextVarObj) + _nextVarObj->_prevVarObj = _prevVarObj; + + _prevVarObj = 0; + _nextVarObj = 0; + + GameVar *s = _subVars; + + while (s) { + delete s; + s = _subVars; + } + + s = _field_14; + + while (s) { + delete s; + s = _field_14; + } + + free(_varName); } bool GameVar::load(MfcArchive &file) { |