WINTERMUTE: Rename transfer(void *) to transferPtr(void *) to avoid overload-misses.

This commit is contained in:
Einar Johan Trøan Sømåen 2013-04-19 17:16:57 +02:00
parent 60a474d452
commit 72d0affe01
46 changed files with 234 additions and 176 deletions

View File

@ -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));

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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));

View File

@ -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));

View File

@ -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;

View File

@ -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;

View File

@ -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));

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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));

View File

@ -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) {

View File

@ -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);

View File

@ -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;
}

View File

@ -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));

View File

@ -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));

View File

@ -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()) {

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -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.

View File

@ -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));

View File

@ -36,30 +36,9 @@ namespace Wintermute {
// Basically Common::Array with peristence-support.
template<typename TYPE>
class BaseArray : public Common::Array<TYPE> {
class BaseArrayBase : public Common::Array<TYPE> {
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<TYPE>::size();
persistMgr->transfer("ArraySize", &j);
typename Common::Array<TYPE>::const_iterator it = Common::Array<TYPE>::begin();
for (; it != Common::Array<TYPE>::end(); ++it) {
TYPE obj = *it;
persistMgr->transfer("", &obj);
}
} else {
Common::Array<TYPE>::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<TYPE>::push_back(newElement);
return Common::Array<TYPE>::size() - 1;
@ -76,11 +55,89 @@ public:
}
}
template<typename T2>
void copy(const BaseArray<T2> &src) {
void copy(const BaseArrayBase<T2> &src) {
Common::Array<TYPE>::insert_at(0, src);
}
};
template <typename TYPE>
class BaseArray : public BaseArrayBase<TYPE> {
public:
bool persist(BasePersistenceManager *persistMgr) {
int j;
if (persistMgr->getIsSaving()) {
j = Common::Array<TYPE>::size();
persistMgr->transfer("ArraySize", &j);
typename Common::Array<TYPE>::const_iterator it = Common::Array<TYPE>::begin();
for (; it != Common::Array<TYPE>::end(); ++it) {
TYPE obj = *it;
persistMgr->transferPtr("", &obj);
}
} else {
Common::Array<TYPE>::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<char *> : public BaseArrayBase<char *> {
public:
bool persist(BasePersistenceManager *persistMgr) {
int j;
if (persistMgr->getIsSaving()) {
j = Common::Array<char *>::size();
persistMgr->transfer("ArraySize", &j);
Common::Array<char *>::const_iterator it = Common::Array<char *>::begin();
for (; it != Common::Array<char *>::end(); ++it) {
char * obj = *it;
persistMgr->transfer("", &obj);
}
} else {
Common::Array<char *>::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<const char *> : public BaseArrayBase<const char *> {
public:
bool persist(BasePersistenceManager *persistMgr) {
int j;
if (persistMgr->getIsSaving()) {
j = Common::Array<const char *>::size();
persistMgr->transfer("ArraySize", &j);
Common::Array<const char *>::const_iterator it = Common::Array<const char *>::begin();
for (; it != Common::Array<const char *>::end(); ++it) {
const char * obj = *it;
persistMgr->transfer("", &obj);
}
} else {
Common::Array<const char *>::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

View File

@ -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

View File

@ -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));

View File

@ -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));

View File

@ -359,7 +359,7 @@ bool UIEntity::persist(BasePersistenceManager *persistMgr) {
UIObject::persist(persistMgr);
persistMgr->transfer(TMEMBER(_entity));
persistMgr->transferPtr(TMEMBER_PTR(_entity));
return STATUS_OK;
}

View File

@ -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));

View File

@ -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));

View File

@ -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);

View File

@ -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));