diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp index 9879cc9f404..e4c18d6287b 100644 --- a/engines/wintermute/ad/ad_actor.cpp +++ b/engines/wintermute/ad/ad_actor.cpp @@ -1320,23 +1320,23 @@ bool AdActor::persist(BasePersistenceManager *persistMgr) { AdTalkHolder::persist(persistMgr); persistMgr->transfer(TMEMBER_INT(_dir)); - persistMgr->transfer(TMEMBER(_path)); + persistMgr->transferPtr(TMEMBER_PTR(_path)); persistMgr->transfer(TMEMBER(_pFCount)); persistMgr->transfer(TMEMBER(_pFStepX)); persistMgr->transfer(TMEMBER(_pFStepY)); persistMgr->transfer(TMEMBER(_pFX)); persistMgr->transfer(TMEMBER(_pFY)); - persistMgr->transfer(TMEMBER(_standSprite)); + persistMgr->transferPtr(TMEMBER_PTR(_standSprite)); _talkSprites.persist(persistMgr); _talkSpritesEx.persist(persistMgr); persistMgr->transfer(TMEMBER_INT(_targetDir)); persistMgr->transfer(TMEMBER_INT(_afterWalkDir)); - persistMgr->transfer(TMEMBER(_targetPoint)); - persistMgr->transfer(TMEMBER(_turnLeftSprite)); - persistMgr->transfer(TMEMBER(_turnRightSprite)); - persistMgr->transfer(TMEMBER(_walkSprite)); + persistMgr->transferPtr(TMEMBER_PTR(_targetPoint)); + persistMgr->transferPtr(TMEMBER_PTR(_turnLeftSprite)); + persistMgr->transferPtr(TMEMBER_PTR(_turnRightSprite)); + persistMgr->transferPtr(TMEMBER_PTR(_walkSprite)); - persistMgr->transfer(TMEMBER(_animSprite2)); + persistMgr->transferPtr(TMEMBER_PTR(_animSprite2)); persistMgr->transfer(TMEMBER(_talkAnimName)); persistMgr->transfer(TMEMBER(_idleAnimName)); persistMgr->transfer(TMEMBER(_walkAnimName)); diff --git a/engines/wintermute/ad/ad_entity.cpp b/engines/wintermute/ad/ad_entity.cpp index 6e47d0f072f..c43f74b6200 100644 --- a/engines/wintermute/ad/ad_entity.cpp +++ b/engines/wintermute/ad/ad_entity.cpp @@ -1093,7 +1093,7 @@ bool AdEntity::persist(BasePersistenceManager *persistMgr) { AdTalkHolder::persist(persistMgr); persistMgr->transfer(TMEMBER(_item)); - persistMgr->transfer(TMEMBER(_region)); + persistMgr->transferPtr(TMEMBER_PTR(_region)); //persistMgr->transfer(TMEMBER(_sprite)); persistMgr->transfer(TMEMBER_INT(_subtype)); _talkSprites.persist(persistMgr); @@ -1103,7 +1103,7 @@ bool AdEntity::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_walkToY)); persistMgr->transfer(TMEMBER_INT(_walkToDir)); - persistMgr->transfer(TMEMBER(_theora)); + persistMgr->transferPtr(TMEMBER_PTR(_theora)); return STATUS_OK; } diff --git a/engines/wintermute/ad/ad_game.cpp b/engines/wintermute/ad/ad_game.cpp index fac59dc473f..ead68f77297 100644 --- a/engines/wintermute/ad/ad_game.cpp +++ b/engines/wintermute/ad/ad_game.cpp @@ -1413,32 +1413,32 @@ bool AdGame::persist(BasePersistenceManager *persistMgr) { _dlgPendingBranches.persist(persistMgr); _inventories.persist(persistMgr); - persistMgr->transfer(TMEMBER(_inventoryBox)); + persistMgr->transferPtr(TMEMBER_PTR(_inventoryBox)); _objects.persist(persistMgr); persistMgr->transfer(TMEMBER(_prevSceneName)); persistMgr->transfer(TMEMBER(_prevSceneFilename)); - persistMgr->transfer(TMEMBER(_responseBox)); + persistMgr->transferPtr(TMEMBER_PTR(_responseBox)); _responsesBranch.persist(persistMgr); _responsesGame.persist(persistMgr); - persistMgr->transfer(TMEMBER(_scene)); + persistMgr->transferPtr(TMEMBER_PTR(_scene)); _sceneStates.persist(persistMgr); persistMgr->transfer(TMEMBER(_scheduledFadeIn)); persistMgr->transfer(TMEMBER(_scheduledScene)); - persistMgr->transfer(TMEMBER(_selectedItem)); + persistMgr->transferPtr(TMEMBER_PTR(_selectedItem)); persistMgr->transfer(TMEMBER_INT(_talkSkipButton)); _sentences.persist(persistMgr); - persistMgr->transfer(TMEMBER(_sceneViewport)); + persistMgr->transferPtr(TMEMBER_PTR(_sceneViewport)); persistMgr->transfer(TMEMBER_INT(_stateEx)); persistMgr->transfer(TMEMBER(_initialScene)); persistMgr->transfer(TMEMBER(_debugStartupScene)); - persistMgr->transfer(TMEMBER(_invObject)); - persistMgr->transfer(TMEMBER(_inventoryOwner)); + persistMgr->transferPtr(TMEMBER_PTR(_invObject)); + persistMgr->transferPtr(TMEMBER_PTR(_inventoryOwner)); persistMgr->transfer(TMEMBER(_tempDisableSaveState)); _items.persist(persistMgr); diff --git a/engines/wintermute/ad/ad_inventory_box.cpp b/engines/wintermute/ad/ad_inventory_box.cpp index 4bb0905688b..87554245cfa 100644 --- a/engines/wintermute/ad/ad_inventory_box.cpp +++ b/engines/wintermute/ad/ad_inventory_box.cpp @@ -371,7 +371,7 @@ bool AdInventoryBox::saveAsText(BaseDynamicBuffer *buffer, int indent) { bool AdInventoryBox::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_closeButton)); + persistMgr->transferPtr(TMEMBER_PTR(_closeButton)); persistMgr->transfer(TMEMBER(_hideSelected)); persistMgr->transfer(TMEMBER(_itemHeight)); persistMgr->transfer(TMEMBER(_itemsArea)); @@ -380,7 +380,7 @@ bool AdInventoryBox::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_scrollOffset)); persistMgr->transfer(TMEMBER(_spacing)); persistMgr->transfer(TMEMBER(_visible)); - persistMgr->transfer(TMEMBER(_window)); + persistMgr->transferPtr(TMEMBER_PTR(_window)); persistMgr->transfer(TMEMBER(_exclusive)); return STATUS_OK; diff --git a/engines/wintermute/ad/ad_item.cpp b/engines/wintermute/ad/ad_item.cpp index 578105105c0..1a46eb783be 100644 --- a/engines/wintermute/ad/ad_item.cpp +++ b/engines/wintermute/ad/ad_item.cpp @@ -784,9 +784,9 @@ bool AdItem::persist(BasePersistenceManager *persistMgr) { AdTalkHolder::persist(persistMgr); persistMgr->transfer(TMEMBER(_cursorCombined)); - persistMgr->transfer(TMEMBER(_cursorHover)); - persistMgr->transfer(TMEMBER(_cursorNormal)); - persistMgr->transfer(TMEMBER(_spriteHover)); + persistMgr->transferPtr(TMEMBER_PTR(_cursorHover)); + persistMgr->transferPtr(TMEMBER_PTR(_cursorNormal)); + persistMgr->transferPtr(TMEMBER_PTR(_spriteHover)); persistMgr->transfer(TMEMBER(_inInventory)); persistMgr->transfer(TMEMBER(_displayAmount)); persistMgr->transfer(TMEMBER(_amount)); diff --git a/engines/wintermute/ad/ad_node_state.cpp b/engines/wintermute/ad/ad_node_state.cpp index c741dec54f9..d52201a08d4 100644 --- a/engines/wintermute/ad/ad_node_state.cpp +++ b/engines/wintermute/ad/ad_node_state.cpp @@ -93,7 +93,7 @@ void AdNodeState::setCursor(const char *filename) { ////////////////////////////////////////////////////////////////////////// bool AdNodeState::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER(_active)); persistMgr->transfer(TMEMBER(_name)); diff --git a/engines/wintermute/ad/ad_object.cpp b/engines/wintermute/ad/ad_object.cpp index 9026b2849c2..6f9c85d3b5a 100644 --- a/engines/wintermute/ad/ad_object.cpp +++ b/engines/wintermute/ad/ad_object.cpp @@ -1031,39 +1031,39 @@ bool AdObject::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); persistMgr->transfer(TMEMBER(_active)); - persistMgr->transfer(TMEMBER(_blockRegion)); - persistMgr->transfer(TMEMBER(_currentBlockRegion)); - persistMgr->transfer(TMEMBER(_currentWptGroup)); - persistMgr->transfer(TMEMBER(_currentSprite)); + persistMgr->transferPtr(TMEMBER_PTR(_blockRegion)); + persistMgr->transferPtr(TMEMBER_PTR(_currentBlockRegion)); + persistMgr->transferPtr(TMEMBER_PTR(_currentWptGroup)); + persistMgr->transferPtr(TMEMBER_PTR(_currentSprite)); persistMgr->transfer(TMEMBER(_drawn)); - persistMgr->transfer(TMEMBER(_font)); + persistMgr->transferPtr(TMEMBER_PTR(_font)); persistMgr->transfer(TMEMBER(_ignoreItems)); persistMgr->transfer(TMEMBER_INT(_nextState)); - persistMgr->transfer(TMEMBER(_sentence)); + persistMgr->transferPtr(TMEMBER_PTR(_sentence)); persistMgr->transfer(TMEMBER_INT(_state)); - persistMgr->transfer(TMEMBER(_animSprite)); + persistMgr->transferPtr(TMEMBER_PTR(_animSprite)); persistMgr->transfer(TMEMBER(_sceneIndependent)); persistMgr->transfer(TMEMBER(_forcedTalkAnimName)); persistMgr->transfer(TMEMBER(_forcedTalkAnimUsed)); - persistMgr->transfer(TMEMBER(_tempSprite2)); + persistMgr->transferPtr(TMEMBER_PTR(_tempSprite2)); persistMgr->transfer(TMEMBER_INT(_type)); - persistMgr->transfer(TMEMBER(_wptGroup)); - persistMgr->transfer(TMEMBER(_stickRegion)); + persistMgr->transferPtr(TMEMBER_PTR(_wptGroup)); + persistMgr->transferPtr(TMEMBER_PTR(_stickRegion)); persistMgr->transfer(TMEMBER(_subtitlesModRelative)); persistMgr->transfer(TMEMBER(_subtitlesModX)); persistMgr->transfer(TMEMBER(_subtitlesModY)); persistMgr->transfer(TMEMBER(_subtitlesModXCenter)); persistMgr->transfer(TMEMBER(_subtitlesWidth)); - persistMgr->transfer(TMEMBER(_inventory)); - persistMgr->transfer(TMEMBER(_partEmitter)); + persistMgr->transferPtr(TMEMBER_PTR(_inventory)); + persistMgr->transferPtr(TMEMBER_PTR(_partEmitter)); for (int i = 0; i < MAX_NUM_REGIONS; i++) { - persistMgr->transfer(TMEMBER(_currentRegions[i])); + persistMgr->transferPtr(TMEMBER_PTR(_currentRegions[i])); } _attachmentsPre.persist(persistMgr); _attachmentsPost.persist(persistMgr); - persistMgr->transfer(TMEMBER(_registerAlias)); + persistMgr->transferPtr(TMEMBER_PTR(_registerAlias)); persistMgr->transfer(TMEMBER(_partFollowParent)); persistMgr->transfer(TMEMBER(_partOffsetX)); diff --git a/engines/wintermute/ad/ad_path.cpp b/engines/wintermute/ad/ad_path.cpp index afdd29828ce..5b36ed64718 100644 --- a/engines/wintermute/ad/ad_path.cpp +++ b/engines/wintermute/ad/ad_path.cpp @@ -108,7 +108,7 @@ bool AdPath::setReady(bool ready) { ////////////////////////////////////////////////////////////////////////// bool AdPath::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER(_currIndex)); _points.persist(persistMgr); diff --git a/engines/wintermute/ad/ad_path_point.cpp b/engines/wintermute/ad/ad_path_point.cpp index f3ccd264b16..be4b4874666 100644 --- a/engines/wintermute/ad/ad_path_point.cpp +++ b/engines/wintermute/ad/ad_path_point.cpp @@ -67,7 +67,7 @@ bool AdPathPoint::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_distance)); persistMgr->transfer(TMEMBER(_marked)); - persistMgr->transfer(TMEMBER(_origin)); + persistMgr->transferPtr(TMEMBER_PTR(_origin)); return STATUS_OK; } diff --git a/engines/wintermute/ad/ad_response.cpp b/engines/wintermute/ad/ad_response.cpp index 0e6817ae6f7..4483bbc667f 100644 --- a/engines/wintermute/ad/ad_response.cpp +++ b/engines/wintermute/ad/ad_response.cpp @@ -131,14 +131,14 @@ bool AdResponse::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_icon)); - persistMgr->transfer(TMEMBER(_iconHover)); - persistMgr->transfer(TMEMBER(_iconPressed)); + persistMgr->transferPtr(TMEMBER_PTR(_icon)); + persistMgr->transferPtr(TMEMBER_PTR(_iconHover)); + persistMgr->transferPtr(TMEMBER_PTR(_iconPressed)); persistMgr->transfer(TMEMBER(_iD)); persistMgr->transfer(TMEMBER(_text)); persistMgr->transfer(TMEMBER(_textOrig)); persistMgr->transfer(TMEMBER_INT(_responseType)); - persistMgr->transfer(TMEMBER(_font)); + persistMgr->transferPtr(TMEMBER_PTR(_font)); return STATUS_OK; } diff --git a/engines/wintermute/ad/ad_response_box.cpp b/engines/wintermute/ad/ad_response_box.cpp index a4e59c6a499..df86bce29ce 100644 --- a/engines/wintermute/ad/ad_response_box.cpp +++ b/engines/wintermute/ad/ad_response_box.cpp @@ -573,8 +573,8 @@ bool AdResponseBox::listen(BaseScriptHolder *param1, uint32 param2) { bool AdResponseBox::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_font)); - persistMgr->transfer(TMEMBER(_fontHover)); + persistMgr->transferPtr(TMEMBER_PTR(_font)); + persistMgr->transferPtr(TMEMBER_PTR(_fontHover)); persistMgr->transfer(TMEMBER(_horizontal)); persistMgr->transfer(TMEMBER(_lastResponseText)); persistMgr->transfer(TMEMBER(_lastResponseTextOrig)); @@ -582,10 +582,10 @@ bool AdResponseBox::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_responseArea)); _responses.persist(persistMgr); persistMgr->transfer(TMEMBER(_scrollOffset)); - persistMgr->transfer(TMEMBER(_shieldWindow)); + persistMgr->transferPtr(TMEMBER_PTR(_shieldWindow)); persistMgr->transfer(TMEMBER(_spacing)); - persistMgr->transfer(TMEMBER(_waitingScript)); - persistMgr->transfer(TMEMBER(_window)); + persistMgr->transferPtr(TMEMBER_PTR(_waitingScript)); + persistMgr->transferPtr(TMEMBER_PTR(_window)); persistMgr->transfer(TMEMBER_INT(_verticalAlign)); persistMgr->transfer(TMEMBER_INT(_align)); diff --git a/engines/wintermute/ad/ad_response_context.cpp b/engines/wintermute/ad/ad_response_context.cpp index d87651c1789..663ef49a249 100644 --- a/engines/wintermute/ad/ad_response_context.cpp +++ b/engines/wintermute/ad/ad_response_context.cpp @@ -49,7 +49,7 @@ AdResponseContext::~AdResponseContext() { ////////////////////////////////////////////////////////////////////////// bool AdResponseContext::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER(_context)); persistMgr->transfer(TMEMBER(_id)); diff --git a/engines/wintermute/ad/ad_scene.cpp b/engines/wintermute/ad/ad_scene.cpp index 699ef0685d7..e3f198bdd2d 100644 --- a/engines/wintermute/ad/ad_scene.cpp +++ b/engines/wintermute/ad/ad_scene.cpp @@ -2319,13 +2319,13 @@ bool AdScene::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_editorShowEntities)); persistMgr->transfer(TMEMBER(_editorShowRegions)); persistMgr->transfer(TMEMBER(_editorShowScale)); - persistMgr->transfer(TMEMBER(_fader)); + persistMgr->transferPtr(TMEMBER_PTR(_fader)); persistMgr->transfer(TMEMBER(_height)); persistMgr->transfer(TMEMBER(_initialized)); persistMgr->transfer(TMEMBER(_lastTimeH)); persistMgr->transfer(TMEMBER(_lastTimeV)); _layers.persist(persistMgr); - persistMgr->transfer(TMEMBER(_mainLayer)); + persistMgr->transferPtr(TMEMBER_PTR(_mainLayer)); _objects.persist(persistMgr); persistMgr->transfer(TMEMBER(_offsetLeft)); persistMgr->transfer(TMEMBER(_offsetTop)); @@ -2336,20 +2336,20 @@ bool AdScene::persist(BasePersistenceManager *persistMgr) { _pfPath.persist(persistMgr); persistMgr->transfer(TMEMBER(_pfPointsNum)); persistMgr->transfer(TMEMBER(_pfReady)); - persistMgr->transfer(TMEMBER(_pfRequester)); - persistMgr->transfer(TMEMBER(_pfTarget)); - persistMgr->transfer(TMEMBER(_pfTargetPath)); + persistMgr->transferPtr(TMEMBER_PTR(_pfRequester)); + persistMgr->transferPtr(TMEMBER_PTR(_pfTarget)); + persistMgr->transferPtr(TMEMBER_PTR(_pfTargetPath)); _rotLevels.persist(persistMgr); _scaleLevels.persist(persistMgr); persistMgr->transfer(TMEMBER(_scrollPixelsH)); persistMgr->transfer(TMEMBER(_scrollPixelsV)); persistMgr->transfer(TMEMBER(_scrollTimeH)); persistMgr->transfer(TMEMBER(_scrollTimeV)); - persistMgr->transfer(TMEMBER(_shieldWindow)); + persistMgr->transferPtr(TMEMBER_PTR(_shieldWindow)); persistMgr->transfer(TMEMBER(_targetOffsetLeft)); persistMgr->transfer(TMEMBER(_targetOffsetTop)); _waypointGroups.persist(persistMgr); - persistMgr->transfer(TMEMBER(_viewport)); + persistMgr->transferPtr(TMEMBER_PTR(_viewport)); persistMgr->transfer(TMEMBER(_width)); return STATUS_OK; diff --git a/engines/wintermute/ad/ad_scene_node.cpp b/engines/wintermute/ad/ad_scene_node.cpp index f84e9212e55..e9b80b3cc8a 100644 --- a/engines/wintermute/ad/ad_scene_node.cpp +++ b/engines/wintermute/ad/ad_scene_node.cpp @@ -72,8 +72,8 @@ bool AdSceneNode::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_entity)); - persistMgr->transfer(TMEMBER(_region)); + persistMgr->transferPtr(TMEMBER_PTR(_entity)); + persistMgr->transferPtr(TMEMBER_PTR(_region)); persistMgr->transfer(TMEMBER_INT(_type)); return STATUS_OK; diff --git a/engines/wintermute/ad/ad_sentence.cpp b/engines/wintermute/ad/ad_sentence.cpp index 9192b74c4eb..196a7acd0b3 100644 --- a/engines/wintermute/ad/ad_sentence.cpp +++ b/engines/wintermute/ad/ad_sentence.cpp @@ -247,20 +247,20 @@ bool AdSentence::finish() { ////////////////////////////////////////////////////////////////////////// bool AdSentence::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER_INT(_align)); persistMgr->transfer(TMEMBER(_currentStance)); - persistMgr->transfer(TMEMBER(_currentSprite)); + persistMgr->transferPtr(TMEMBER_PTR(_currentSprite)); persistMgr->transfer(TMEMBER(_currentSkelAnim)); persistMgr->transfer(TMEMBER(_duration)); - persistMgr->transfer(TMEMBER(_font)); + persistMgr->transferPtr(TMEMBER_PTR(_font)); persistMgr->transfer(TMEMBER(_pos)); - persistMgr->transfer(TMEMBER(_sound)); + persistMgr->transferPtr(TMEMBER_PTR(_sound)); persistMgr->transfer(TMEMBER(_soundStarted)); persistMgr->transfer(TMEMBER(_stances)); persistMgr->transfer(TMEMBER(_startTime)); - persistMgr->transfer(TMEMBER(_talkDef)); + persistMgr->transferPtr(TMEMBER_PTR(_talkDef)); persistMgr->transfer(TMEMBER(_tempStance)); persistMgr->transfer(TMEMBER(_text)); persistMgr->transfer(TMEMBER(_width)); diff --git a/engines/wintermute/ad/ad_sprite_set.cpp b/engines/wintermute/ad/ad_sprite_set.cpp index ffa7bb25309..6c802c4863d 100644 --- a/engines/wintermute/ad/ad_sprite_set.cpp +++ b/engines/wintermute/ad/ad_sprite_set.cpp @@ -249,9 +249,9 @@ bool AdSpriteSet::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_owner)); + persistMgr->transferPtr(TMEMBER_PTR(_owner)); for (int i = 0; i < NUM_DIRECTIONS; i++) { - persistMgr->transfer("", &_sprites[i]); + persistMgr->transferPtr("", &_sprites[i]); } return STATUS_OK; diff --git a/engines/wintermute/ad/ad_talk_def.cpp b/engines/wintermute/ad/ad_talk_def.cpp index 4ad5d2ccc6a..bf72b2916b1 100644 --- a/engines/wintermute/ad/ad_talk_def.cpp +++ b/engines/wintermute/ad/ad_talk_def.cpp @@ -208,9 +208,9 @@ bool AdTalkDef::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_defaultSprite)); + persistMgr->transferPtr(TMEMBER_PTR(_defaultSprite)); persistMgr->transfer(TMEMBER(_defaultSpriteFilename)); - persistMgr->transfer(TMEMBER(_defaultSpriteSet)); + persistMgr->transferPtr(TMEMBER_PTR(_defaultSpriteSet)); persistMgr->transfer(TMEMBER(_defaultSpriteSetFilename)); _nodes.persist(persistMgr); diff --git a/engines/wintermute/ad/ad_talk_holder.cpp b/engines/wintermute/ad/ad_talk_holder.cpp index ed2333a3455..33deab78058 100644 --- a/engines/wintermute/ad/ad_talk_holder.cpp +++ b/engines/wintermute/ad/ad_talk_holder.cpp @@ -392,7 +392,7 @@ bool AdTalkHolder::saveAsText(BaseDynamicBuffer *buffer, int indent) { bool AdTalkHolder::persist(BasePersistenceManager *persistMgr) { AdObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_sprite)); + persistMgr->transferPtr(TMEMBER_PTR(_sprite)); _talkSprites.persist(persistMgr); _talkSpritesEx.persist(persistMgr); diff --git a/engines/wintermute/ad/ad_talk_node.cpp b/engines/wintermute/ad/ad_talk_node.cpp index 2e0985ed99d..f03c24ea941 100644 --- a/engines/wintermute/ad/ad_talk_node.cpp +++ b/engines/wintermute/ad/ad_talk_node.cpp @@ -195,9 +195,9 @@ bool AdTalkNode::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_startTime)); persistMgr->transfer(TMEMBER(_endTime)); persistMgr->transfer(TMEMBER(_playToEnd)); - persistMgr->transfer(TMEMBER(_sprite)); + persistMgr->transferPtr(TMEMBER_PTR(_sprite)); persistMgr->transfer(TMEMBER(_spriteFilename)); - persistMgr->transfer(TMEMBER(_spriteSet)); + persistMgr->transferPtr(TMEMBER_PTR(_spriteSet)); persistMgr->transfer(TMEMBER(_spriteSetFilename)); return STATUS_OK; diff --git a/engines/wintermute/base/base_frame.cpp b/engines/wintermute/base/base_frame.cpp index 382e8acbe0f..9fb5770f792 100644 --- a/engines/wintermute/base/base_frame.cpp +++ b/engines/wintermute/base/base_frame.cpp @@ -420,7 +420,7 @@ bool BaseFrame::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_killSound)); persistMgr->transfer(TMEMBER(_moveX)); persistMgr->transfer(TMEMBER(_moveY)); - persistMgr->transfer(TMEMBER(_sound)); + persistMgr->transferPtr(TMEMBER_PTR(_sound)); _subframes.persist(persistMgr); return STATUS_OK; diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index 0f2a3d12605..aaa6c90e9b9 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -3055,18 +3055,18 @@ bool BaseGame::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_activeObject)); - persistMgr->transfer(TMEMBER(_capturedObject)); - persistMgr->transfer(TMEMBER(_cursorNoninteractive)); + persistMgr->transferPtr(TMEMBER_PTR(_activeObject)); + persistMgr->transferPtr(TMEMBER_PTR(_capturedObject)); + persistMgr->transferPtr(TMEMBER_PTR(_cursorNoninteractive)); persistMgr->transfer(TMEMBER(_editorMode)); - persistMgr->transfer(TMEMBER(_fader)); + persistMgr->transferPtr(TMEMBER_PTR(_fader)); persistMgr->transfer(TMEMBER(_freezeLevel)); - persistMgr->transfer(TMEMBER(_focusedWindow)); - persistMgr->transfer(TMEMBER(_fontStorage)); + persistMgr->transferPtr(TMEMBER_PTR(_focusedWindow)); + persistMgr->transferPtr(TMEMBER_PTR(_fontStorage)); persistMgr->transfer(TMEMBER(_interactive)); - persistMgr->transfer(TMEMBER(_keyboardState)); + persistMgr->transferPtr(TMEMBER_PTR(_keyboardState)); persistMgr->transfer(TMEMBER(_lastTime)); - persistMgr->transfer(TMEMBER(_mainObject)); + persistMgr->transferPtr(TMEMBER_PTR(_mainObject)); _musicSystem->persistChannels(persistMgr); _musicSystem->persistCrossfadeSettings(persistMgr); @@ -3082,14 +3082,14 @@ bool BaseGame::persist(BasePersistenceManager *persistMgr) { _regObjects.persist(persistMgr); - persistMgr->transfer(TMEMBER(_scEngine)); + persistMgr->transferPtr(TMEMBER_PTR(_scEngine)); //persistMgr->transfer(TMEMBER(_soundMgr)); persistMgr->transfer(TMEMBER_INT(_state)); //persistMgr->transfer(TMEMBER(_surfaceStorage)); persistMgr->transfer(TMEMBER(_subtitles)); persistMgr->transfer(TMEMBER(_subtitlesSpeed)); - persistMgr->transfer(TMEMBER(_systemFont)); - persistMgr->transfer(TMEMBER(_videoFont)); + persistMgr->transferPtr(TMEMBER_PTR(_systemFont)); + persistMgr->transferPtr(TMEMBER_PTR(_videoFont)); persistMgr->transfer(TMEMBER(_videoSubtitles)); _timerNormal.persist(persistMgr); diff --git a/engines/wintermute/base/base_game_music.cpp b/engines/wintermute/base/base_game_music.cpp index a39deb8d8d7..ac23801e4ce 100644 --- a/engines/wintermute/base/base_game_music.cpp +++ b/engines/wintermute/base/base_game_music.cpp @@ -214,7 +214,7 @@ bool BaseGameMusic::updateMusicCrossfade() { bool BaseGameMusic::persistChannels(BasePersistenceManager *persistMgr) { for (int i = 0; i < NUM_MUSIC_CHANNELS; i++) { - persistMgr->transfer(TMEMBER(_music[i])); + persistMgr->transferPtr(TMEMBER_PTR(_music[i])); persistMgr->transfer(TMEMBER(_musicStartTime[i])); } return true; diff --git a/engines/wintermute/base/base_object.cpp b/engines/wintermute/base/base_object.cpp index 75ba4fb50f5..ad181b922e6 100644 --- a/engines/wintermute/base/base_object.cpp +++ b/engines/wintermute/base/base_object.cpp @@ -955,10 +955,10 @@ bool BaseObject::persist(BasePersistenceManager *persistMgr) { for (int i = 0; i < 7; i++) { persistMgr->transfer(TMEMBER(_caption[i])); } - persistMgr->transfer(TMEMBER(_activeCursor)); + persistMgr->transferPtr(TMEMBER_PTR(_activeCursor)); persistMgr->transfer(TMEMBER(_alphaColor)); persistMgr->transfer(TMEMBER(_autoSoundPanning)); - persistMgr->transfer(TMEMBER(_cursor)); + persistMgr->transferPtr(TMEMBER_PTR(_cursor)); persistMgr->transfer(TMEMBER(_sharedCursors)); persistMgr->transfer(TMEMBER(_editorAlwaysRegister)); persistMgr->transfer(TMEMBER(_editorOnly)); @@ -971,7 +971,7 @@ bool BaseObject::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_relativeScale)); persistMgr->transfer(TMEMBER(_rotatable)); persistMgr->transfer(TMEMBER(_scale)); - persistMgr->transfer(TMEMBER(_sFX)); + persistMgr->transferPtr(TMEMBER_PTR(_sFX)); persistMgr->transfer(TMEMBER(_sFXStart)); persistMgr->transfer(TMEMBER(_sFXVolume)); persistMgr->transfer(TMEMBER(_ready)); diff --git a/engines/wintermute/base/base_persistence_manager.cpp b/engines/wintermute/base/base_persistence_manager.cpp index 12bc62d5dc9..aec540dcf08 100644 --- a/engines/wintermute/base/base_persistence_manager.cpp +++ b/engines/wintermute/base/base_persistence_manager.cpp @@ -848,7 +848,8 @@ bool BasePersistenceManager::transfer(const char *name, Vector2 *val) { ////////////////////////////////////////////////////////////////////////// // generic pointer -bool BasePersistenceManager::transfer(const char *name, void *val) { + +bool BasePersistenceManager::transferPtr(const char *name, void *val) { int classID = -1, instanceID = -1; if (_saving) { @@ -869,7 +870,6 @@ bool BasePersistenceManager::transfer(const char *name, void *val) { return STATUS_OK; } - ////////////////////////////////////////////////////////////////////////// bool BasePersistenceManager::checkVersion(byte verMajor, byte verMinor, byte verBuild) { if (_saving) { diff --git a/engines/wintermute/base/base_persistence_manager.h b/engines/wintermute/base/base_persistence_manager.h index 8cc21b353b5..4ae7e3fb142 100644 --- a/engines/wintermute/base/base_persistence_manager.h +++ b/engines/wintermute/base/base_persistence_manager.h @@ -73,7 +73,7 @@ public: uint32 _richBufferSize; byte *_richBuffer; - bool transfer(const char *name, void *val); + bool transferPtr(const char *name, void *val); bool transfer(const char *name, int *val); bool transfer(const char *name, uint32 *val); bool transfer(const char *name, float *val); diff --git a/engines/wintermute/base/base_scriptable.cpp b/engines/wintermute/base/base_scriptable.cpp index fca1df4c905..5753b0482be 100644 --- a/engines/wintermute/base/base_scriptable.cpp +++ b/engines/wintermute/base/base_scriptable.cpp @@ -152,10 +152,10 @@ void BaseScriptable::scSetBool(bool val) { ////////////////////////////////////////////////////////////////////////// bool BaseScriptable::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER(_refCount)); - persistMgr->transfer(TMEMBER(_scProp)); - persistMgr->transfer(TMEMBER(_scValue)); + persistMgr->transferPtr(TMEMBER_PTR(_scProp)); + persistMgr->transferPtr(TMEMBER_PTR(_scValue)); return STATUS_OK; } diff --git a/engines/wintermute/base/base_sprite.cpp b/engines/wintermute/base/base_sprite.cpp index 3f809f7a468..4e01fa5251f 100644 --- a/engines/wintermute/base/base_sprite.cpp +++ b/engines/wintermute/base/base_sprite.cpp @@ -539,7 +539,7 @@ bool BaseSprite::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_looping)); persistMgr->transfer(TMEMBER(_moveX)); persistMgr->transfer(TMEMBER(_moveY)); - persistMgr->transfer(TMEMBER(_owner)); + persistMgr->transferPtr(TMEMBER_PTR(_owner)); persistMgr->transfer(TMEMBER(_precise)); persistMgr->transfer(TMEMBER(_streamed)); persistMgr->transfer(TMEMBER(_streamedKeepLoaded)); diff --git a/engines/wintermute/base/base_viewport.cpp b/engines/wintermute/base/base_viewport.cpp index 4f62a4f6f90..557ba740370 100644 --- a/engines/wintermute/base/base_viewport.cpp +++ b/engines/wintermute/base/base_viewport.cpp @@ -53,9 +53,9 @@ BaseViewport::~BaseViewport() { ////////////////////////////////////////////////////////////////////////// bool BaseViewport::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); - persistMgr->transfer(TMEMBER(_mainObject)); + persistMgr->transferPtr(TMEMBER_PTR(_mainObject)); persistMgr->transfer(TMEMBER(_offsetX)); persistMgr->transfer(TMEMBER(_offsetY)); persistMgr->transfer(TMEMBER(_rect)); diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp index 351444a1dbe..03bd4716364 100644 --- a/engines/wintermute/base/font/base_font_bitmap.cpp +++ b/engines/wintermute/base/font/base_font_bitmap.cpp @@ -498,10 +498,10 @@ bool BaseFontBitmap::persist(BasePersistenceManager *persistMgr) { BaseFont::persist(persistMgr); persistMgr->transfer(TMEMBER(_numColumns)); - persistMgr->transfer(TMEMBER(_subframe)); + persistMgr->transferPtr(TMEMBER_PTR(_subframe)); persistMgr->transfer(TMEMBER(_tileHeight)); persistMgr->transfer(TMEMBER(_tileWidth)); - persistMgr->transfer(TMEMBER(_sprite)); + persistMgr->transferPtr(TMEMBER_PTR(_sprite)); persistMgr->transfer(TMEMBER(_widthsFrame)); if (persistMgr->getIsSaving()) { diff --git a/engines/wintermute/base/font/base_font_storage.cpp b/engines/wintermute/base/font/base_font_storage.cpp index 6a625f30aed..3286742478e 100644 --- a/engines/wintermute/base/font/base_font_storage.cpp +++ b/engines/wintermute/base/font/base_font_storage.cpp @@ -132,7 +132,7 @@ bool BaseFontStorage::persist(BasePersistenceManager *persistMgr) { cleanup(false); } - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); _fonts.persist(persistMgr); return STATUS_OK; diff --git a/engines/wintermute/base/particles/part_emitter.cpp b/engines/wintermute/base/particles/part_emitter.cpp index d09f2215dd2..c86e1ce369c 100644 --- a/engines/wintermute/base/particles/part_emitter.cpp +++ b/engines/wintermute/base/particles/part_emitter.cpp @@ -1212,7 +1212,7 @@ bool PartEmitter::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER_INT(_batchesGenerated)); persistMgr->transfer(TMEMBER(_emitEvent)); - persistMgr->transfer(TMEMBER(_owner)); + persistMgr->transferPtr(TMEMBER_PTR(_owner)); _sprites.persist(persistMgr); diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp index 56ffbf75c54..2d7b3329c86 100644 --- a/engines/wintermute/base/scriptables/script.cpp +++ b/engines/wintermute/base/scriptables/script.cpp @@ -1243,7 +1243,7 @@ void ScScript::runtimeError(const char *fmt, ...) { ////////////////////////////////////////////////////////////////////////// bool ScScript::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); // buffer if (persistMgr->getIsSaving()) { @@ -1268,33 +1268,33 @@ bool ScScript::persist(BasePersistenceManager *persistMgr) { } } - persistMgr->transfer(TMEMBER(_callStack)); + persistMgr->transferPtr(TMEMBER_PTR(_callStack)); persistMgr->transfer(TMEMBER(_currentLine)); - persistMgr->transfer(TMEMBER(_engine)); + persistMgr->transferPtr(TMEMBER_PTR(_engine)); persistMgr->transfer(TMEMBER(_filename)); persistMgr->transfer(TMEMBER(_freezable)); - persistMgr->transfer(TMEMBER(_globals)); + persistMgr->transferPtr(TMEMBER_PTR(_globals)); persistMgr->transfer(TMEMBER(_iP)); - persistMgr->transfer(TMEMBER(_scopeStack)); - persistMgr->transfer(TMEMBER(_stack)); + persistMgr->transferPtr(TMEMBER_PTR(_scopeStack)); + persistMgr->transferPtr(TMEMBER_PTR(_stack)); persistMgr->transfer(TMEMBER_INT(_state)); - persistMgr->transfer(TMEMBER(_operand)); + persistMgr->transferPtr(TMEMBER_PTR(_operand)); persistMgr->transfer(TMEMBER_INT(_origState)); - persistMgr->transfer(TMEMBER(_owner)); - persistMgr->transfer(TMEMBER(_reg1)); + persistMgr->transferPtr(TMEMBER_PTR(_owner)); + persistMgr->transferPtr(TMEMBER_PTR(_reg1)); persistMgr->transfer(TMEMBER(_thread)); persistMgr->transfer(TMEMBER(_threadEvent)); - persistMgr->transfer(TMEMBER(_thisStack)); + persistMgr->transferPtr(TMEMBER_PTR(_thisStack)); persistMgr->transfer(TMEMBER(_timeSlice)); - persistMgr->transfer(TMEMBER(_waitObject)); - persistMgr->transfer(TMEMBER(_waitScript)); + persistMgr->transferPtr(TMEMBER_PTR(_waitObject)); + persistMgr->transferPtr(TMEMBER_PTR(_waitScript)); persistMgr->transfer(TMEMBER(_waitTime)); persistMgr->transfer(TMEMBER(_waitFrozen)); persistMgr->transfer(TMEMBER(_methodThread)); persistMgr->transfer(TMEMBER(_methodThread)); persistMgr->transfer(TMEMBER(_unbreakable)); - persistMgr->transfer(TMEMBER(_parentScript)); + persistMgr->transferPtr(TMEMBER_PTR(_parentScript)); if (!persistMgr->getIsSaving()) { _tracingMode = false; diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp index d8f38f2f4d2..f83fb368432 100644 --- a/engines/wintermute/base/scriptables/script_engine.cpp +++ b/engines/wintermute/base/scriptables/script_engine.cpp @@ -484,9 +484,9 @@ bool ScEngine::persist(BasePersistenceManager *persistMgr) { cleanup(); } - persistMgr->transfer(TMEMBER(_gameRef)); - persistMgr->transfer(TMEMBER(_currentScript)); - persistMgr->transfer(TMEMBER(_globals)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_currentScript)); + persistMgr->transferPtr(TMEMBER_PTR(_globals)); _scripts.persist(persistMgr); return STATUS_OK; diff --git a/engines/wintermute/base/scriptables/script_ext_array.cpp b/engines/wintermute/base/scriptables/script_ext_array.cpp index 892d0674ff5..a466d361ec1 100644 --- a/engines/wintermute/base/scriptables/script_ext_array.cpp +++ b/engines/wintermute/base/scriptables/script_ext_array.cpp @@ -215,7 +215,7 @@ bool SXArray::persist(BasePersistenceManager *persistMgr) { BaseScriptable::persist(persistMgr); persistMgr->transfer(TMEMBER(_length)); - persistMgr->transfer(TMEMBER(_values)); + persistMgr->transferPtr(TMEMBER_PTR(_values)); return STATUS_OK; } diff --git a/engines/wintermute/base/scriptables/script_stack.cpp b/engines/wintermute/base/scriptables/script_stack.cpp index 3239decae83..b53457c81b0 100644 --- a/engines/wintermute/base/scriptables/script_stack.cpp +++ b/engines/wintermute/base/scriptables/script_stack.cpp @@ -184,7 +184,7 @@ void ScStack::pushNative(BaseScriptable *val, bool persistent) { ////////////////////////////////////////////////////////////////////////// bool ScStack::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER(_sP)); _values.persist(persistMgr); diff --git a/engines/wintermute/base/scriptables/script_value.cpp b/engines/wintermute/base/scriptables/script_value.cpp index 46d6c25d44b..5ad8a84baa3 100644 --- a/engines/wintermute/base/scriptables/script_value.cpp +++ b/engines/wintermute/base/scriptables/script_value.cpp @@ -789,7 +789,7 @@ void ScValue::setValue(ScValue *val) { ////////////////////////////////////////////////////////////////////////// bool ScValue::persist(BasePersistenceManager *persistMgr) { - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER(_persistent)); persistMgr->transfer(TMEMBER(_isConstVar)); @@ -797,7 +797,7 @@ bool ScValue::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_valBool)); persistMgr->transfer(TMEMBER(_valFloat)); persistMgr->transfer(TMEMBER(_valInt)); - persistMgr->transfer(TMEMBER(_valNative)); + persistMgr->transferPtr(TMEMBER_PTR(_valNative)); int size; const char *str; @@ -808,23 +808,23 @@ bool ScValue::persist(BasePersistenceManager *persistMgr) { while (_valIter != _valObject.end()) { str = _valIter->_key.c_str(); persistMgr->transfer("", &str); - persistMgr->transfer("", &_valIter->_value); + persistMgr->transferPtr("", &_valIter->_value); _valIter++; } } else { - ScValue *val; + ScValue *val = nullptr; persistMgr->transfer("", &size); for (int i = 0; i < size; i++) { persistMgr->transfer("", &str); - persistMgr->transfer("", &val); + persistMgr->transferPtr("", &val); _valObject[str] = val; delete[] str; } } - persistMgr->transfer(TMEMBER(_valRef)); + persistMgr->transferPtr(TMEMBER_PTR(_valRef)); persistMgr->transfer(TMEMBER(_valString)); /* // TODO: Convert to Debug-statements. diff --git a/engines/wintermute/base/sound/base_sound.cpp b/engines/wintermute/base/sound/base_sound.cpp index f246c03fe12..d027c03c8b7 100644 --- a/engines/wintermute/base/sound/base_sound.cpp +++ b/engines/wintermute/base/sound/base_sound.cpp @@ -164,7 +164,7 @@ bool BaseSound::persist(BasePersistenceManager *persistMgr) { _sFXParam1 = _sFXParam2 = _sFXParam3 = _sFXParam4 = 0; } - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER(_soundFilename)); persistMgr->transfer(TMEMBER(_soundLooping)); diff --git a/engines/wintermute/coll_templ.h b/engines/wintermute/coll_templ.h index 493ea070159..6b96048f86a 100644 --- a/engines/wintermute/coll_templ.h +++ b/engines/wintermute/coll_templ.h @@ -36,30 +36,9 @@ namespace Wintermute { // Basically Common::Array with peristence-support. template -class BaseArray : public Common::Array { +class BaseArrayBase : public Common::Array { public: // TODO: Might want to make sure that destructors are called when replacing/deleting/getting destructed - bool persist(BasePersistenceManager *persistMgr) { - int j; - if (persistMgr->getIsSaving()) { - j = Common::Array::size(); - persistMgr->transfer("ArraySize", &j); - typename Common::Array::const_iterator it = Common::Array::begin(); - for (; it != Common::Array::end(); ++it) { - TYPE obj = *it; - persistMgr->transfer("", &obj); - } - } else { - Common::Array::clear(); - persistMgr->transfer("ArraySize", &j); - for (int i = 0; i < j; i++) { - TYPE obj; - persistMgr->transfer("", &obj); - add(obj); - } - } - return true; - } int add(TYPE newElement) { Common::Array::push_back(newElement); return Common::Array::size() - 1; @@ -76,11 +55,89 @@ public: } } template - void copy(const BaseArray &src) { + void copy(const BaseArrayBase &src) { Common::Array::insert_at(0, src); } }; +template +class BaseArray : public BaseArrayBase { + public: + bool persist(BasePersistenceManager *persistMgr) { + int j; + if (persistMgr->getIsSaving()) { + j = Common::Array::size(); + persistMgr->transfer("ArraySize", &j); + typename Common::Array::const_iterator it = Common::Array::begin(); + for (; it != Common::Array::end(); ++it) { + TYPE obj = *it; + persistMgr->transferPtr("", &obj); + } + } else { + Common::Array::clear(); + persistMgr->transfer("ArraySize", &j); + for (int i = 0; i < j; i++) { + TYPE obj = nullptr; + persistMgr->transferPtr("", &obj); + this->add(obj); + } + } + return true; + } +}; + +template <> +class BaseArray : public BaseArrayBase { + public: + bool persist(BasePersistenceManager *persistMgr) { + int j; + if (persistMgr->getIsSaving()) { + j = Common::Array::size(); + persistMgr->transfer("ArraySize", &j); + Common::Array::const_iterator it = Common::Array::begin(); + for (; it != Common::Array::end(); ++it) { + char * obj = *it; + persistMgr->transfer("", &obj); + } + } else { + Common::Array::clear(); + persistMgr->transfer("ArraySize", &j); + for (int i = 0; i < j; i++) { + char * obj = nullptr; + persistMgr->transfer("", &obj); + add(obj); + } + } + return true; + } +}; + +template <> +class BaseArray : public BaseArrayBase { +public: + bool persist(BasePersistenceManager *persistMgr) { + int j; + if (persistMgr->getIsSaving()) { + j = Common::Array::size(); + persistMgr->transfer("ArraySize", &j); + Common::Array::const_iterator it = Common::Array::begin(); + for (; it != Common::Array::end(); ++it) { + const char * obj = *it; + persistMgr->transfer("", &obj); + } + } else { + Common::Array::clear(); + persistMgr->transfer("ArraySize", &j); + for (int i = 0; i < j; i++) { + const char * obj = nullptr; + persistMgr->transfer("", &obj); + add(obj); + } + } + return true; + } +}; + } // end of namespace Wintermute #endif diff --git a/engines/wintermute/persistent.h b/engines/wintermute/persistent.h index ca9281f7987..f760384fb90 100644 --- a/engines/wintermute/persistent.h +++ b/engines/wintermute/persistent.h @@ -82,6 +82,7 @@ namespace Wintermute { }\ #define TMEMBER(memberName) #memberName, &memberName +#define TMEMBER_PTR(memberName) #memberName, &memberName #define TMEMBER_INT(memberName) #memberName, (int*)&memberName } // end of namespace Wintermute diff --git a/engines/wintermute/ui/ui_button.cpp b/engines/wintermute/ui/ui_button.cpp index b638522f6ed..9db1f4f4b42 100644 --- a/engines/wintermute/ui/ui_button.cpp +++ b/engines/wintermute/ui/ui_button.cpp @@ -1179,21 +1179,21 @@ bool UIButton::persist(BasePersistenceManager *persistMgr) { UIObject::persist(persistMgr); persistMgr->transfer(TMEMBER_INT(_align)); - persistMgr->transfer(TMEMBER(_backDisable)); - persistMgr->transfer(TMEMBER(_backFocus)); - persistMgr->transfer(TMEMBER(_backHover)); - persistMgr->transfer(TMEMBER(_backPress)); + persistMgr->transferPtr(TMEMBER_PTR(_backDisable)); + persistMgr->transferPtr(TMEMBER_PTR(_backFocus)); + persistMgr->transferPtr(TMEMBER_PTR(_backHover)); + persistMgr->transferPtr(TMEMBER_PTR(_backPress)); persistMgr->transfer(TMEMBER(_centerImage)); - persistMgr->transfer(TMEMBER(_fontDisable)); - persistMgr->transfer(TMEMBER(_fontFocus)); - persistMgr->transfer(TMEMBER(_fontHover)); - persistMgr->transfer(TMEMBER(_fontPress)); + persistMgr->transferPtr(TMEMBER_PTR(_fontDisable)); + persistMgr->transferPtr(TMEMBER_PTR(_fontFocus)); + persistMgr->transferPtr(TMEMBER_PTR(_fontHover)); + persistMgr->transferPtr(TMEMBER_PTR(_fontPress)); persistMgr->transfer(TMEMBER(_hover)); - persistMgr->transfer(TMEMBER(_image)); - persistMgr->transfer(TMEMBER(_imageDisable)); - persistMgr->transfer(TMEMBER(_imageFocus)); - persistMgr->transfer(TMEMBER(_imageHover)); - persistMgr->transfer(TMEMBER(_imagePress)); + persistMgr->transferPtr(TMEMBER_PTR(_image)); + persistMgr->transferPtr(TMEMBER_PTR(_imageDisable)); + persistMgr->transferPtr(TMEMBER_PTR(_imageFocus)); + persistMgr->transferPtr(TMEMBER_PTR(_imageHover)); + persistMgr->transferPtr(TMEMBER_PTR(_imagePress)); persistMgr->transfer(TMEMBER(_pixelPerfect)); persistMgr->transfer(TMEMBER(_press)); persistMgr->transfer(TMEMBER(_stayPressed)); diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp index 7fddf598981..cc3955066bb 100644 --- a/engines/wintermute/ui/ui_edit.cpp +++ b/engines/wintermute/ui/ui_edit.cpp @@ -934,7 +934,7 @@ bool UIEdit::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_cursorBlinkRate)); persistMgr->transfer(TMEMBER(_cursorChar)); - persistMgr->transfer(TMEMBER(_fontSelected)); + persistMgr->transferPtr(TMEMBER_PTR(_fontSelected)); persistMgr->transfer(TMEMBER(_frameWidth)); persistMgr->transfer(TMEMBER(_maxLength)); persistMgr->transfer(TMEMBER(_scrollOffset)); diff --git a/engines/wintermute/ui/ui_entity.cpp b/engines/wintermute/ui/ui_entity.cpp index 00d442e895f..1872400cddc 100644 --- a/engines/wintermute/ui/ui_entity.cpp +++ b/engines/wintermute/ui/ui_entity.cpp @@ -359,7 +359,7 @@ bool UIEntity::persist(BasePersistenceManager *persistMgr) { UIObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_entity)); + persistMgr->transferPtr(TMEMBER_PTR(_entity)); return STATUS_OK; } diff --git a/engines/wintermute/ui/ui_object.cpp b/engines/wintermute/ui/ui_object.cpp index 9dea3dadf9d..07efc5e4cb4 100644 --- a/engines/wintermute/ui/ui_object.cpp +++ b/engines/wintermute/ui/ui_object.cpp @@ -621,17 +621,17 @@ bool UIObject::persist(BasePersistenceManager *persistMgr) { BaseObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_back)); + persistMgr->transferPtr(TMEMBER_PTR(_back)); persistMgr->transfer(TMEMBER(_canFocus)); persistMgr->transfer(TMEMBER(_disable)); - persistMgr->transfer(TMEMBER(_focusedWidget)); - persistMgr->transfer(TMEMBER(_font)); + persistMgr->transferPtr(TMEMBER_PTR(_focusedWidget)); + persistMgr->transferPtr(TMEMBER_PTR(_font)); persistMgr->transfer(TMEMBER(_height)); - persistMgr->transfer(TMEMBER(_image)); - persistMgr->transfer(TMEMBER(_listenerObject)); - persistMgr->transfer(TMEMBER(_listenerParamObject)); + persistMgr->transferPtr(TMEMBER_PTR(_image)); + persistMgr->transferPtr(TMEMBER_PTR(_listenerObject)); + persistMgr->transferPtr(TMEMBER_PTR(_listenerParamObject)); persistMgr->transfer(TMEMBER(_listenerParamDWORD)); - persistMgr->transfer(TMEMBER(_parent)); + persistMgr->transferPtr(TMEMBER_PTR(_parent)); persistMgr->transfer(TMEMBER(_parentNotify)); persistMgr->transfer(TMEMBER(_sharedFonts)); persistMgr->transfer(TMEMBER(_sharedImages)); diff --git a/engines/wintermute/ui/ui_tiled_image.cpp b/engines/wintermute/ui/ui_tiled_image.cpp index be9f87cf581..7e1de951cf2 100644 --- a/engines/wintermute/ui/ui_tiled_image.cpp +++ b/engines/wintermute/ui/ui_tiled_image.cpp @@ -377,7 +377,7 @@ bool UITiledImage::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_downLeft)); persistMgr->transfer(TMEMBER(_downMiddle)); persistMgr->transfer(TMEMBER(_downRight)); - persistMgr->transfer(TMEMBER(_image)); + persistMgr->transferPtr(TMEMBER_PTR(_image)); persistMgr->transfer(TMEMBER(_middleLeft)); persistMgr->transfer(TMEMBER(_middleMiddle)); persistMgr->transfer(TMEMBER(_middleRight)); diff --git a/engines/wintermute/ui/ui_window.cpp b/engines/wintermute/ui/ui_window.cpp index 460ec1877be..2ce9f68605c 100644 --- a/engines/wintermute/ui/ui_window.cpp +++ b/engines/wintermute/ui/ui_window.cpp @@ -1257,24 +1257,24 @@ bool UIWindow::persist(BasePersistenceManager *persistMgr) { UIObject::persist(persistMgr); - persistMgr->transfer(TMEMBER(_backInactive)); + persistMgr->transferPtr(TMEMBER_PTR(_backInactive)); persistMgr->transfer(TMEMBER(_clipContents)); persistMgr->transfer(TMEMBER(_dragFrom)); persistMgr->transfer(TMEMBER(_dragging)); persistMgr->transfer(TMEMBER(_dragRect)); persistMgr->transfer(TMEMBER(_fadeBackground)); persistMgr->transfer(TMEMBER(_fadeColor)); - persistMgr->transfer(TMEMBER(_fontInactive)); - persistMgr->transfer(TMEMBER(_imageInactive)); + persistMgr->transferPtr(TMEMBER_PTR(_fontInactive)); + persistMgr->transferPtr(TMEMBER_PTR(_imageInactive)); persistMgr->transfer(TMEMBER(_inGame)); persistMgr->transfer(TMEMBER(_isMenu)); persistMgr->transfer(TMEMBER_INT(_mode)); - persistMgr->transfer(TMEMBER(_shieldButton)); - persistMgr->transfer(TMEMBER(_shieldWindow)); + persistMgr->transferPtr(TMEMBER_PTR(_shieldButton)); + persistMgr->transferPtr(TMEMBER_PTR(_shieldWindow)); persistMgr->transfer(TMEMBER_INT(_titleAlign)); persistMgr->transfer(TMEMBER(_titleRect)); persistMgr->transfer(TMEMBER(_transparent)); - persistMgr->transfer(TMEMBER(_viewport)); + persistMgr->transferPtr(TMEMBER_PTR(_viewport)); persistMgr->transfer(TMEMBER(_pauseMusic)); _widgets.persist(persistMgr); diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index f03be9691e0..8f9db8392f0 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -491,7 +491,7 @@ bool VideoTheoraPlayer::persist(BasePersistenceManager *persistMgr) { SetDefaults(); } - persistMgr->transfer(TMEMBER(_gameRef)); + persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transfer(TMEMBER(_savedPos)); persistMgr->transfer(TMEMBER(_savedState)); persistMgr->transfer(TMEMBER(_filename));