[Scummvm-git-logs] scummvm master -> 9edb1249a37403a91a0a5706f0aa1073edf57a2a
kelmer44
noreply at scummvm.org
Wed Oct 8 05:16:08 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
9edb1249a3 TOT: Turn savegame register into a pointer.
Commit: 9edb1249a37403a91a0a5706f0aa1073edf57a2a
https://github.com/scummvm/scummvm/commit/9edb1249a37403a91a0a5706f0aa1073edf57a2a
Author: kelmer (kelmer at gmail.com)
Date: 2025-10-08T07:15:58+02:00
Commit Message:
TOT: Turn savegame register into a pointer.
Changed paths:
engines/tot/saveload.cpp
engines/tot/tot.h
diff --git a/engines/tot/saveload.cpp b/engines/tot/saveload.cpp
index fdf3858ffc4..3689c05186a 100644
--- a/engines/tot/saveload.cpp
+++ b/engines/tot/saveload.cpp
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-#include "common/translation.h"
#include "common/savefile.h"
+#include "common/translation.h"
#include "graphics/thumbnail.h"
#include "gui/message.h"
@@ -30,102 +30,102 @@ namespace Tot {
#define SAVEGAME_CURRENT_VERSION 1
-bool syncGeneralData(Common::Serializer &s, SavedGame &game) {
+bool syncGeneralData(Common::Serializer &s, SavedGame *game) {
// Uint16
- s.syncAsUint16LE(game.roomCode);
- s.syncAsUint16LE(game.trajectoryLength);
- s.syncAsUint16LE(game.currentTrajectoryIndex);
- s.syncAsUint16LE(game.backpackObjectCode);
- s.syncAsUint16LE(game.rightSfxVol);
- s.syncAsUint16LE(game.leftSfxVol);
- s.syncAsUint16LE(game.musicVolRight);
- s.syncAsUint16LE(game.musicVolLeft);
- s.syncAsUint16LE(game.oldGridX);
- s.syncAsUint16LE(game.oldGridY);
- s.syncAsUint16LE(game.secAnimDepth);
- s.syncAsUint16LE(game.secAnimDir);
- s.syncAsUint16LE(game.secAnimX);
- s.syncAsUint16LE(game.secAnimY);
- s.syncAsUint16LE(game.secAnimIFrame);
+ s.syncAsUint16LE(game->roomCode);
+ s.syncAsUint16LE(game->trajectoryLength);
+ s.syncAsUint16LE(game->currentTrajectoryIndex);
+ s.syncAsUint16LE(game->backpackObjectCode);
+ s.syncAsUint16LE(game->rightSfxVol);
+ s.syncAsUint16LE(game->leftSfxVol);
+ s.syncAsUint16LE(game->musicVolRight);
+ s.syncAsUint16LE(game->musicVolLeft);
+ s.syncAsUint16LE(game->oldGridX);
+ s.syncAsUint16LE(game->oldGridY);
+ s.syncAsUint16LE(game->secAnimDepth);
+ s.syncAsUint16LE(game->secAnimDir);
+ s.syncAsUint16LE(game->secAnimX);
+ s.syncAsUint16LE(game->secAnimY);
+ s.syncAsUint16LE(game->secAnimIFrame);
// Bytes
- s.syncAsByte(game.currentZone);
- s.syncAsByte(game.targetZone);
- s.syncAsByte(game.oldTargetZone);
- s.syncAsByte(game.inventoryPosition);
- s.syncAsByte(game.actionCode);
- s.syncAsByte(game.oldActionCode);
- s.syncAsByte(game.steps);
- s.syncAsByte(game.doorIndex);
- s.syncAsByte(game.characterFacingDir);
- s.syncAsByte(game.iframe);
- s.syncAsByte(game.gamePart);
+ s.syncAsByte(game->currentZone);
+ s.syncAsByte(game->targetZone);
+ s.syncAsByte(game->oldTargetZone);
+ s.syncAsByte(game->inventoryPosition);
+ s.syncAsByte(game->actionCode);
+ s.syncAsByte(game->oldActionCode);
+ s.syncAsByte(game->steps);
+ s.syncAsByte(game->doorIndex);
+ s.syncAsByte(game->characterFacingDir);
+ s.syncAsByte(game->iframe);
+ s.syncAsByte(game->gamePart);
// Booleans
- s.syncAsByte(game.isSealRemoved);
- s.syncAsByte(game.obtainedList1);
- s.syncAsByte(game.obtainedList2);
- s.syncAsByte(game.list1Complete);
- s.syncAsByte(game.list2Complete);
- s.syncAsByte(game.isVasePlaced);
- s.syncAsByte(game.isScytheTaken);
- s.syncAsByte(game.isTridentTaken);
- s.syncAsByte(game.isPottersWheelDelivered);
- s.syncAsByte(game.isMudDelivered);
- s.syncAsByte(game.isGreenDevilDelivered);
- s.syncAsByte(game.isRedDevilCaptured);
- s.syncAsByte(game.isPottersManualDelivered);
- s.syncAsByte(game.isCupboardOpen);
- s.syncAsByte(game.isChestOpen);
- s.syncAsByte(game.isTVOn);
- s.syncAsByte(game.isTrapSet);
+ s.syncAsByte(game->isSealRemoved);
+ s.syncAsByte(game->obtainedList1);
+ s.syncAsByte(game->obtainedList2);
+ s.syncAsByte(game->list1Complete);
+ s.syncAsByte(game->list2Complete);
+ s.syncAsByte(game->isVasePlaced);
+ s.syncAsByte(game->isScytheTaken);
+ s.syncAsByte(game->isTridentTaken);
+ s.syncAsByte(game->isPottersWheelDelivered);
+ s.syncAsByte(game->isMudDelivered);
+ s.syncAsByte(game->isGreenDevilDelivered);
+ s.syncAsByte(game->isRedDevilCaptured);
+ s.syncAsByte(game->isPottersManualDelivered);
+ s.syncAsByte(game->isCupboardOpen);
+ s.syncAsByte(game->isChestOpen);
+ s.syncAsByte(game->isTVOn);
+ s.syncAsByte(game->isTrapSet);
for (int i = 0; i < kInventoryIconCount; i++) {
- s.syncAsUint16LE(game.mobj[i].bitmapIndex);
- s.syncAsUint16LE(game.mobj[i].code);
- s.syncString(game.mobj[i].objectName);
+ s.syncAsUint16LE(game->mobj[i].bitmapIndex);
+ s.syncAsUint16LE(game->mobj[i].code);
+ s.syncString(game->mobj[i].objectName);
}
// integers
- s.syncAsSint32LE(game.element1);
- s.syncAsSint32LE(game.element2);
- s.syncAsSint32LE(game.characterPosX);
- s.syncAsSint32LE(game.characterPosY);
- s.syncAsSint32LE(game.xframe2);
- s.syncAsSint32LE(game.yframe2);
+ s.syncAsSint32LE(game->element1);
+ s.syncAsSint32LE(game->element2);
+ s.syncAsSint32LE(game->characterPosX);
+ s.syncAsSint32LE(game->characterPosY);
+ s.syncAsSint32LE(game->xframe2);
+ s.syncAsSint32LE(game->yframe2);
// Strings
- s.syncString(game.oldInventoryObjectName);
- s.syncString(game.objetomoinventoryObjectNamehila);
- s.syncString(game.characterName);
+ s.syncString(game->oldInventoryObjectName);
+ s.syncString(game->objetomoinventoryObjectNamehila);
+ s.syncString(game->characterName);
for (int i = 0; i < kRoutePointCount; i++) {
- s.syncAsSint16LE(game.mainRoute[i].x);
- s.syncAsSint16LE(game.mainRoute[i].y);
+ s.syncAsSint16LE(game->mainRoute[i].x);
+ s.syncAsSint16LE(game->mainRoute[i].y);
}
for (int i = 0; i < 300; i++) {
- s.syncAsSint16LE(game.trajectory[i].x);
- s.syncAsSint16LE(game.trajectory[i].y);
+ s.syncAsSint16LE(game->trajectory[i].x);
+ s.syncAsSint16LE(game->trajectory[i].y);
}
for (int indiaux = 0; indiaux < kCharacterCount; indiaux++) {
// interleave them just to avoid creating many loops
- s.syncAsByte(game.firstTimeTopicA[indiaux]);
- s.syncAsByte(game.firstTimeTopicB[indiaux]);
- s.syncAsByte(game.firstTimeTopicC[indiaux]);
- s.syncAsByte(game.bookTopic[indiaux]);
- s.syncAsByte(game.mintTopic[indiaux]);
+ s.syncAsByte(game->firstTimeTopicA[indiaux]);
+ s.syncAsByte(game->firstTimeTopicB[indiaux]);
+ s.syncAsByte(game->firstTimeTopicC[indiaux]);
+ s.syncAsByte(game->bookTopic[indiaux]);
+ s.syncAsByte(game->mintTopic[indiaux]);
}
for (int indiaux = 0; indiaux < 5; indiaux++) {
- s.syncAsByte(game.caves[indiaux]);
- s.syncAsUint16LE(game.firstList[indiaux]);
- s.syncAsUint16LE(game.secondList[indiaux]);
+ s.syncAsByte(game->caves[indiaux]);
+ s.syncAsUint16LE(game->firstList[indiaux]);
+ s.syncAsUint16LE(game->secondList[indiaux]);
}
for (int indiaux = 0; indiaux < 4; indiaux++) {
- s.syncAsUint16LE(game.niche[0][indiaux]);
- s.syncAsUint16LE(game.niche[1][indiaux]);
+ s.syncAsUint16LE(game->niche[0][indiaux]);
+ s.syncAsUint16LE(game->niche[1][indiaux]);
}
return true;
}
@@ -197,7 +197,7 @@ bool syncItemData(Common::Serializer &s, Common::MemorySeekableReadWriteStream *
return true;
}
-Common::Error syncSaveData(Common::Serializer &ser, SavedGame &game) {
+Common::Error syncSaveData(Common::Serializer &ser, SavedGame *game) {
if (!syncGeneralData(ser, game)) {
warning("Error while synchronizing general data");
return Common::kUnknownError;
@@ -226,7 +226,7 @@ Common::Error TotEngine::syncGame(Common::Serializer &s) {
Common::Error result;
if (s.isLoading()) {
- SavedGame loadedGame;
+ SavedGame *loadedGame = new SavedGame();
// Means we are loading from before the game has started
// if(rooms == nullptr) {
g_engine->_graphics->clear();
@@ -247,8 +247,9 @@ Common::Error TotEngine::syncGame(Common::Serializer &s) {
result = syncSaveData(s, loadedGame);
loadGame(loadedGame);
} else {
- saveGameToRegister();
- result = syncSaveData(s, _savedGame);
+ SavedGame *saveGame = saveGameToRegister();
+ result = syncSaveData(s, saveGame);
+ free(saveGame);
}
return result;
}
@@ -282,195 +283,197 @@ bool TotEngine::canSaveGameStateCurrently(Common::U32String *msg) {
return _inGame && _saveAllowed;
}
-void TotEngine::saveGameToRegister() {
- _savedGame.roomCode = _currentRoomData->code;
- _savedGame.trajectoryLength = _trajectoryLength;
- _savedGame.currentTrajectoryIndex = _currentTrajectoryIndex;
- _savedGame.backpackObjectCode = _backpackObjectCode;
- _savedGame.rightSfxVol = _sound->_rightSfxVol;
- _savedGame.leftSfxVol = _sound->_leftSfxVol;
- _savedGame.musicVolRight = _sound->_musicVolRight;
- _savedGame.musicVolLeft = _sound->_musicVolLeft;
- _savedGame.oldGridX = _oldGridX;
- _savedGame.oldGridY = _oldGridY;
- _savedGame.secAnimDepth = _secondaryAnimation.depth;
- _savedGame.secAnimDir = _secondaryAnimation.dir;
- _savedGame.secAnimX = _secondaryAnimation.posx;
- _savedGame.secAnimY = _secondaryAnimation.posy;
- _savedGame.secAnimIFrame = _iframe2;
-
- _savedGame.currentZone = _currentZone;
- _savedGame.targetZone = _targetZone;
- _savedGame.oldTargetZone = _oldTargetZone;
- _savedGame.inventoryPosition = _inventoryPosition;
- _savedGame.actionCode = _actionCode;
- _savedGame.oldActionCode = _oldActionCode;
- _savedGame.steps = _trajectorySteps;
- _savedGame.doorIndex = _doorIndex;
- _savedGame.characterFacingDir = _charFacingDirection;
- _savedGame.iframe = _iframe;
- _savedGame.gamePart = _gamePart;
-
- _savedGame.isSealRemoved = _isSealRemoved;
- _savedGame.obtainedList1 = _obtainedList1;
- _savedGame.obtainedList2 = _obtainedList2;
- _savedGame.list1Complete = _list1Complete;
- _savedGame.list2Complete = _list2Complete;
- _savedGame.isVasePlaced = _isVasePlaced;
- _savedGame.isScytheTaken = _isScytheTaken;
- _savedGame.isTridentTaken = _isTridentTaken;
- _savedGame.isPottersWheelDelivered = _isPottersWheelDelivered;
- _savedGame.isMudDelivered = _isMudDelivered;
- _savedGame.isGreenDevilDelivered = _isGreenDevilDelivered;
- _savedGame.isRedDevilCaptured = _isRedDevilCaptured;
- _savedGame.isPottersManualDelivered = _isPottersManualDelivered;
- _savedGame.isCupboardOpen = _isCupboardOpen;
- _savedGame.isChestOpen = _isChestOpen;
- _savedGame.isTVOn = _isTVOn;
- _savedGame.isTrapSet = _isTrapSet;
+SavedGame *TotEngine::saveGameToRegister() {
+ SavedGame *_savedGame = new SavedGame();
+ _savedGame->roomCode = _currentRoomData->code;
+ _savedGame->trajectoryLength = _trajectoryLength;
+ _savedGame->currentTrajectoryIndex = _currentTrajectoryIndex;
+ _savedGame->backpackObjectCode = _backpackObjectCode;
+ _savedGame->rightSfxVol = _sound->_rightSfxVol;
+ _savedGame->leftSfxVol = _sound->_leftSfxVol;
+ _savedGame->musicVolRight = _sound->_musicVolRight;
+ _savedGame->musicVolLeft = _sound->_musicVolLeft;
+ _savedGame->oldGridX = _oldGridX;
+ _savedGame->oldGridY = _oldGridY;
+ _savedGame->secAnimDepth = _secondaryAnimation.depth;
+ _savedGame->secAnimDir = _secondaryAnimation.dir;
+ _savedGame->secAnimX = _secondaryAnimation.posx;
+ _savedGame->secAnimY = _secondaryAnimation.posy;
+ _savedGame->secAnimIFrame = _iframe2;
+
+ _savedGame->currentZone = _currentZone;
+ _savedGame->targetZone = _targetZone;
+ _savedGame->oldTargetZone = _oldTargetZone;
+ _savedGame->inventoryPosition = _inventoryPosition;
+ _savedGame->actionCode = _actionCode;
+ _savedGame->oldActionCode = _oldActionCode;
+ _savedGame->steps = _trajectorySteps;
+ _savedGame->doorIndex = _doorIndex;
+ _savedGame->characterFacingDir = _charFacingDirection;
+ _savedGame->iframe = _iframe;
+ _savedGame->gamePart = _gamePart;
+
+ _savedGame->isSealRemoved = _isSealRemoved;
+ _savedGame->obtainedList1 = _obtainedList1;
+ _savedGame->obtainedList2 = _obtainedList2;
+ _savedGame->list1Complete = _list1Complete;
+ _savedGame->list2Complete = _list2Complete;
+ _savedGame->isVasePlaced = _isVasePlaced;
+ _savedGame->isScytheTaken = _isScytheTaken;
+ _savedGame->isTridentTaken = _isTridentTaken;
+ _savedGame->isPottersWheelDelivered = _isPottersWheelDelivered;
+ _savedGame->isMudDelivered = _isMudDelivered;
+ _savedGame->isGreenDevilDelivered = _isGreenDevilDelivered;
+ _savedGame->isRedDevilCaptured = _isRedDevilCaptured;
+ _savedGame->isPottersManualDelivered = _isPottersManualDelivered;
+ _savedGame->isCupboardOpen = _isCupboardOpen;
+ _savedGame->isChestOpen = _isChestOpen;
+ _savedGame->isTVOn = _isTVOn;
+ _savedGame->isTrapSet = _isTrapSet;
for (int i = 0; i < kInventoryIconCount; i++) {
- _savedGame.mobj[i].bitmapIndex = _inventory[i].bitmapIndex;
- _savedGame.mobj[i].code = _inventory[i].code;
- _savedGame.mobj[i].objectName = _inventory[i].objectName;
+ _savedGame->mobj[i].bitmapIndex = _inventory[i].bitmapIndex;
+ _savedGame->mobj[i].code = _inventory[i].code;
+ _savedGame->mobj[i].objectName = _inventory[i].objectName;
}
- _savedGame.element1 = _element1;
- _savedGame.element2 = _element2;
- _savedGame.characterPosX = _characterPosX;
- _savedGame.characterPosY = _characterPosY;
- _savedGame.xframe2 = _xframe2;
- _savedGame.yframe2 = _yframe2;
+ _savedGame->element1 = _element1;
+ _savedGame->element2 = _element2;
+ _savedGame->characterPosX = _characterPosX;
+ _savedGame->characterPosY = _characterPosY;
+ _savedGame->xframe2 = _xframe2;
+ _savedGame->yframe2 = _yframe2;
- _savedGame.oldInventoryObjectName = _oldInventoryObjectName;
- _savedGame.objetomoinventoryObjectNamehila = _inventoryObjectName;
- _savedGame.characterName = _characterName;
+ _savedGame->oldInventoryObjectName = _oldInventoryObjectName;
+ _savedGame->objetomoinventoryObjectNamehila = _inventoryObjectName;
+ _savedGame->characterName = _characterName;
for (int i = 0; i < kRoutePointCount; i++) {
- _savedGame.mainRoute[i].x = _mainRoute[i].x;
- _savedGame.mainRoute[i].y = _mainRoute[i].y;
+ _savedGame->mainRoute[i].x = _mainRoute[i].x;
+ _savedGame->mainRoute[i].y = _mainRoute[i].y;
}
for (int i = 0; i < 300; i++) {
- _savedGame.trajectory[i].x = _trajectory[i].x;
- _savedGame.trajectory[i].y = _trajectory[i].y;
+ _savedGame->trajectory[i].x = _trajectory[i].x;
+ _savedGame->trajectory[i].y = _trajectory[i].y;
}
for (int i = 0; i < kCharacterCount; i++) {
- _savedGame.firstTimeTopicA[i] = _firstTimeTopicA[i];
- _savedGame.firstTimeTopicB[i] = _firstTimeTopicB[i];
- _savedGame.firstTimeTopicC[i] = _firstTimeTopicC[i];
- _savedGame.bookTopic[i] = _bookTopic[i];
- _savedGame.mintTopic[i] = _mintTopic[i];
+ _savedGame->firstTimeTopicA[i] = _firstTimeTopicA[i];
+ _savedGame->firstTimeTopicB[i] = _firstTimeTopicB[i];
+ _savedGame->firstTimeTopicC[i] = _firstTimeTopicC[i];
+ _savedGame->bookTopic[i] = _bookTopic[i];
+ _savedGame->mintTopic[i] = _mintTopic[i];
}
for (int i = 0; i < 5; i++) {
- _savedGame.caves[i] = _caves[i];
- _savedGame.firstList[i] = _firstList[i];
- _savedGame.secondList[i] = _secondList[i];
+ _savedGame->caves[i] = _caves[i];
+ _savedGame->firstList[i] = _firstList[i];
+ _savedGame->secondList[i] = _secondList[i];
}
for (int i = 0; i < 4; i++) {
- _savedGame.niche[0][i] = _niche[0][i];
- _savedGame.niche[1][i] = _niche[1][i];
+ _savedGame->niche[0][i] = _niche[0][i];
+ _savedGame->niche[1][i] = _niche[1][i];
}
+ return _savedGame;
}
-void TotEngine::loadGame(SavedGame game) {
+void TotEngine::loadGame(SavedGame *game) {
clearAnimation();
clearScreenLayers();
- _trajectoryLength = game.trajectoryLength;
- _currentTrajectoryIndex = game.currentTrajectoryIndex;
- _backpackObjectCode = game.backpackObjectCode;
- _sound->_rightSfxVol = game.rightSfxVol;
- _sound->_leftSfxVol = game.leftSfxVol;
- _sound->_musicVolRight = game.musicVolRight;
- _sound->_musicVolLeft = game.musicVolLeft;
- _oldGridX = game.oldGridX;
- _oldGridY = game.oldGridY;
- _secondaryAnimation.depth = game.secAnimDepth;
- _secondaryAnimation.dir = game.secAnimDir;
- _secondaryAnimation.posx = game.secAnimX;
- _secondaryAnimation.posy = game.secAnimY;
- _iframe2 = game.secAnimIFrame;
- _currentZone = game.currentZone;
- _targetZone = game.targetZone;
- _oldTargetZone = game.oldTargetZone;
- _inventoryPosition = game.inventoryPosition;
- _actionCode = game.actionCode;
- _oldActionCode = game.oldActionCode;
- _trajectorySteps = game.steps;
- _doorIndex = game.doorIndex;
- _charFacingDirection = game.characterFacingDir;
- _iframe = game.iframe;
- if (game.gamePart != _gamePart) {
- _gamePart = game.gamePart;
+ _trajectoryLength = game->trajectoryLength;
+ _currentTrajectoryIndex = game->currentTrajectoryIndex;
+ _backpackObjectCode = game->backpackObjectCode;
+ _sound->_rightSfxVol = game->rightSfxVol;
+ _sound->_leftSfxVol = game->leftSfxVol;
+ _sound->_musicVolRight = game->musicVolRight;
+ _sound->_musicVolLeft = game->musicVolLeft;
+ _oldGridX = game->oldGridX;
+ _oldGridY = game->oldGridY;
+ _secondaryAnimation.depth = game->secAnimDepth;
+ _secondaryAnimation.dir = game->secAnimDir;
+ _secondaryAnimation.posx = game->secAnimX;
+ _secondaryAnimation.posy = game->secAnimY;
+ _iframe2 = game->secAnimIFrame;
+ _currentZone = game->currentZone;
+ _targetZone = game->targetZone;
+ _oldTargetZone = game->oldTargetZone;
+ _inventoryPosition = game->inventoryPosition;
+ _actionCode = game->actionCode;
+ _oldActionCode = game->oldActionCode;
+ _trajectorySteps = game->steps;
+ _doorIndex = game->doorIndex;
+ _charFacingDirection = game->characterFacingDir;
+ _iframe = game->iframe;
+ if (game->gamePart != _gamePart) {
+ _gamePart = game->gamePart;
for (int i = 0; i < kInventoryIconCount; i++) {
free(_inventoryIconBitmaps[i]);
}
loadInventory();
}
- _isSealRemoved = game.isSealRemoved;
- _obtainedList1 = game.obtainedList1;
- _obtainedList2 = game.obtainedList2;
- _list1Complete = game.list1Complete;
- _list2Complete = game.list2Complete;
- _isVasePlaced = game.isVasePlaced;
- _isScytheTaken = game.isScytheTaken;
+ _isSealRemoved = game->isSealRemoved;
+ _obtainedList1 = game->obtainedList1;
+ _obtainedList2 = game->obtainedList2;
+ _list1Complete = game->list1Complete;
+ _list2Complete = game->list2Complete;
+ _isVasePlaced = game->isVasePlaced;
+ _isScytheTaken = game->isScytheTaken;
if (_cpCounter > 24)
showError(274);
- _isTridentTaken = game.isTridentTaken;
- _isPottersWheelDelivered = game.isPottersWheelDelivered;
- _isMudDelivered = game.isMudDelivered;
- _isGreenDevilDelivered = game.isGreenDevilDelivered;
- _isRedDevilCaptured = game.isRedDevilCaptured;
- _isPottersManualDelivered = game.isPottersManualDelivered;
- _isCupboardOpen = game.isCupboardOpen;
- _isChestOpen = game.isChestOpen;
- _isTVOn = game.isTVOn;
- _isTrapSet = game.isTrapSet;
+ _isTridentTaken = game->isTridentTaken;
+ _isPottersWheelDelivered = game->isPottersWheelDelivered;
+ _isMudDelivered = game->isMudDelivered;
+ _isGreenDevilDelivered = game->isGreenDevilDelivered;
+ _isRedDevilCaptured = game->isRedDevilCaptured;
+ _isPottersManualDelivered = game->isPottersManualDelivered;
+ _isCupboardOpen = game->isCupboardOpen;
+ _isChestOpen = game->isChestOpen;
+ _isTVOn = game->isTVOn;
+ _isTrapSet = game->isTrapSet;
for (int i = 0; i < kInventoryIconCount; i++) {
- _inventory[i].bitmapIndex = game.mobj[i].bitmapIndex;
- _inventory[i].code = game.mobj[i].code;
- _inventory[i].objectName = game.mobj[i].objectName;
- }
- _element1 = game.element1;
- _element2 = game.element2;
- _characterPosX = game.characterPosX;
- _characterPosY = game.characterPosY;
- _xframe2 = game.xframe2;
- _yframe2 = game.yframe2;
- _oldInventoryObjectName = game.oldInventoryObjectName;
- _inventoryObjectName = game.objetomoinventoryObjectNamehila;
- _characterName = game.characterName;
+ _inventory[i].bitmapIndex = game->mobj[i].bitmapIndex;
+ _inventory[i].code = game->mobj[i].code;
+ _inventory[i].objectName = game->mobj[i].objectName;
+ }
+ _element1 = game->element1;
+ _element2 = game->element2;
+ _characterPosX = game->characterPosX;
+ _characterPosY = game->characterPosY;
+ _xframe2 = game->xframe2;
+ _yframe2 = game->yframe2;
+ _oldInventoryObjectName = game->oldInventoryObjectName;
+ _inventoryObjectName = game->objetomoinventoryObjectNamehila;
+ _characterName = game->characterName;
for (int i = 0; i < kRoutePointCount; i++) {
- _mainRoute[i].x = game.mainRoute[i].x;
- _mainRoute[i].y = game.mainRoute[i].y;
+ _mainRoute[i].x = game->mainRoute[i].x;
+ _mainRoute[i].y = game->mainRoute[i].y;
}
for (int indiaux = 0; indiaux < 300; indiaux++) {
- _trajectory[indiaux].x = game.trajectory[indiaux].x;
- _trajectory[indiaux].y = game.trajectory[indiaux].y;
+ _trajectory[indiaux].x = game->trajectory[indiaux].x;
+ _trajectory[indiaux].y = game->trajectory[indiaux].y;
}
for (int i = 0; i < kCharacterCount; i++) {
- _firstTimeTopicA[i] = game.firstTimeTopicA[i];
- _firstTimeTopicB[i] = game.firstTimeTopicB[i];
- _firstTimeTopicC[i] = game.firstTimeTopicC[i];
- _bookTopic[i] = game.bookTopic[i];
- _mintTopic[i] = game.mintTopic[i];
+ _firstTimeTopicA[i] = game->firstTimeTopicA[i];
+ _firstTimeTopicB[i] = game->firstTimeTopicB[i];
+ _firstTimeTopicC[i] = game->firstTimeTopicC[i];
+ _bookTopic[i] = game->bookTopic[i];
+ _mintTopic[i] = game->mintTopic[i];
}
for (int i = 0; i < 5; i++) {
- _caves[i] = game.caves[i];
- _firstList[i] = game.firstList[i];
- _secondList[i] = game.secondList[i];
+ _caves[i] = game->caves[i];
+ _firstList[i] = game->firstList[i];
+ _secondList[i] = game->secondList[i];
}
for (int i = 0; i < 4; i++) {
- _niche[0][i] = game.niche[0][i];
- _niche[1][i] = game.niche[1][i];
+ _niche[0][i] = game->niche[0][i];
+ _niche[1][i] = game->niche[1][i];
}
_graphics->totalFadeOut(0);
_screen->clear();
_graphics->loadPaletteFromFile("DEFAULT");
- loadScreenData(game.roomCode);
+ loadScreenData(game->roomCode);
switch (_currentRoomData->code) {
case 2: {
diff --git a/engines/tot/tot.h b/engines/tot/tot.h
index f73858d3fa0..338d68a6850 100644
--- a/engines/tot/tot.h
+++ b/engines/tot/tot.h
@@ -86,9 +86,9 @@ private:
void displayLoading();
void runaroundRed();
void sprites(bool drawCharacter);
- void saveGameToRegister();
+ SavedGame *saveGameToRegister();
void originalSaveLoadScreen();
- void loadGame(SavedGame game);
+ void loadGame(SavedGame *game);
RoomFileRegister *readScreenDataFile(Common::SeekableReadStream *screenDataFile);
void lookAtObject(byte objectNumber);
@@ -458,8 +458,6 @@ public:
*/
uint _oldGridX = 0, _oldGridY = 0;
- SavedGame _savedGame;
-
uint _curDepth = 0;
/**
* Point of origin of the area surrounding the main character.
More information about the Scummvm-git-logs
mailing list