ENGINES: Merge saveGameState virtual methods into a single one

This commit is contained in:
Paul Gilbert 2020-02-04 22:13:33 -08:00 committed by Paul Gilbert
parent 1bc068decd
commit a00e44ba6c
123 changed files with 127 additions and 140 deletions

View file

@ -455,7 +455,7 @@ void AccessEngine::freeChar() {
_animation->freeAnimationData();
}
Common::Error AccessEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error AccessEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::OutSaveFile *out = g_system->getSavefileManager()->openForSaving(
generateSaveName(slot));
if (!out)

View file

@ -289,7 +289,7 @@ public:
/**
* Save the game
*/
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
/**
* Returns true if a savegame can currently be loaded

View file

@ -924,7 +924,7 @@ void AdlEngine::saveState(Common::WriteStream &stream) {
stream.writeByte(_state.vars[i]);
}
Common::Error AdlEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error AdlEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::String fileName = Common::String::format("%s.s%02d", _targetName.c_str(), slot);
Common::OutSaveFile *outFile = getSaveFileManager()->openForSaving(fileName);

View file

@ -250,7 +250,7 @@ protected:
// Engine
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
Common::String getDiskImageName(byte volume) const { return Adl::getDiskImageName(*_gameDescription, volume); }

View file

@ -849,7 +849,7 @@ public:
bool promptIsEnabled() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &description) override;
Common::Error saveGameState(int slot, const Common::String &description, bool isAutosave = false) override;
private:
int _keyQueue[KEY_QUEUE_SIZE];

View file

@ -1083,7 +1083,7 @@ Common::Error AgiEngine::loadGameState(int slot) {
}
}
Common::Error AgiEngine::saveGameState(int slot, const Common::String &description) {
Common::Error AgiEngine::saveGameState(int slot, const Common::String &description, bool isAutosave) {
Common::String saveLoadSlot = getSavegameFilename(slot);
if (saveGame(saveLoadSlot, description) == errOK)
return Common::kNoError;

View file

@ -331,7 +331,7 @@ bool AvalancheEngine::canSaveGameStateCurrently() {
return (_animationsEnabled && _alive);
}
Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
return (saveGame(slot, desc) ? Common::kNoError : Common::kWritingFailed);
}

View file

@ -110,7 +110,7 @@ public:
void synchronize(Common::Serializer &sz);
bool canSaveGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool saveGame(const int16 slot, const Common::String &desc);
Common::String getSaveFileName(const int slot);
bool canLoadGameStateCurrently() override;

View file

@ -409,7 +409,7 @@ public:
bool canLoadGameStateCurrently() override { return _isSaveAllowed; }
bool canSaveGameStateCurrently() override { return _isSaveAllowed; }
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &description) override;
Common::Error saveGameState(int slot, const Common::String &description, bool isAutosave = false) override;
void savegame(const char *filename, const char *description);
void loadgame(const char *filename);
const char *getSavegameFilename(int num);

View file

@ -187,7 +187,7 @@ Common::Error BbvsEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error BbvsEngine::saveGameState(int slot, const Common::String &description) {
Common::Error BbvsEngine::saveGameState(int slot, const Common::String &description, bool isAutosave) {
const char *fileName = getSavegameFilename(slot);
savegame(fileName, description.c_str());
return Common::kNoError;

View file

@ -283,7 +283,7 @@ bool BladeRunnerEngine::canSaveGameStateCurrently() {
!_elevator->isOpen();
}
Common::Error BladeRunnerEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error BladeRunnerEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::OutSaveFile *saveFile = BladeRunner::SaveFileManager::openForSaving(_targetName, slot);
if (saveFile == nullptr || saveFile->err()) {
delete saveFile;

View file

@ -257,7 +257,7 @@ public:
bool canLoadGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
bool canSaveGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
void pauseEngineIntern(bool pause) override;
Common::Error run() override;

View file

@ -141,7 +141,7 @@ public:
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
static const int _maxSceneArr[5];
bool _quitFlag;

View file

@ -298,7 +298,7 @@ void CGEEngine::resetGame() {
_commandHandler->reset();
}
Common::Error CGEEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error CGEEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
sceneDown();
_hero->park();
_oldLev = _lev;

View file

@ -158,7 +158,7 @@ public:
bool hasFeature(EngineFeature f) const override;
bool canSaveGameStateCurrently() override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error loadGameState(int slot) override;
Common::Error run() override;

View file

@ -47,7 +47,7 @@ bool CGE2Engine::canSaveGameStateCurrently() {
_commandHandler->idle() && (_soundStat._wait == nullptr);
}
Common::Error CGE2Engine::saveGameState(int slot, const Common::String &desc) {
Common::Error CGE2Engine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
storeHeroPos();
saveGame(slot, desc);
sceneUp(_now);

View file

@ -127,7 +127,7 @@ public:
int modifyGameSpeed(int speedChange);
int getTimerDelay() const;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;

View file

@ -223,7 +223,7 @@ Common::Error CineEngine::loadGameState(int slot) {
return gameLoaded ? Common::kNoError : Common::kUnknownError;
}
Common::Error CineEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error CineEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
// Load savegame descriptions from index file
loadSaveDirectory();

View file

@ -169,7 +169,7 @@ protected:
bool canLoadGameStateCurrently() override { return true; }
Common::Error loadGameState(int slot) override;
bool canSaveGameStateCurrently() override { return true; }
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
public:
ComposerEngine(OSystem *syst, const ComposerGameDescription *gameDesc);

View file

@ -373,7 +373,7 @@ Common::Error ComposerEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error ComposerEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error ComposerEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::String filename = makeSaveGameName(slot);
Common::OutSaveFile *out;
_lastSaveTime = _system->getMillis();

View file

@ -205,7 +205,7 @@ bool CruiseEngine::canLoadGameStateCurrently() {
return playerMenuEnabled != 0;
}
Common::Error CruiseEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error CruiseEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
return saveSavegameData(slot, desc);
}

View file

@ -93,7 +93,7 @@ public:
static const char *getSavegameFile(int saveGameIdx);
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
void syncSoundSettings() override;

View file

@ -232,7 +232,7 @@ public:
bool hasFeature(EngineFeature f) const override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::String prepareFileName(const Common::String &baseName, const char *extension) const {
const char *const extensions[] = { extension, nullptr };

View file

@ -36,7 +36,7 @@ Common::Error CryOmni3DEngine_Versailles::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error CryOmni3DEngine_Versailles::saveGameState(int slot, const Common::String &desc) {
Common::Error CryOmni3DEngine_Versailles::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
saveGame(_isVisiting, slot + 1, desc);
return Common::kNoError;
}

View file

@ -468,7 +468,7 @@ bool DraciEngine::canLoadGameStateCurrently() {
(_game->getLoopSubstatus() == kOuterLoop);
}
Common::Error DraciEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error DraciEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
return saveSavegameData(slot, desc, *this);
}

View file

@ -70,7 +70,7 @@ public:
static Common::String getSavegameFile(int saveGameIdx);
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
Screen *_screen;

View file

@ -330,7 +330,7 @@ public:
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
Common::RandomSource *_rnd;

View file

@ -199,7 +199,7 @@ bool DrasculaEngine::canLoadGameStateCurrently() {
return _canSaveLoad;
}
Common::Error DrasculaEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error DrasculaEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
saveGame(slot, desc);
return Common::kNoError;
}

View file

@ -239,7 +239,7 @@ Common::Error DreamWebEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error DreamWebEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error DreamWebEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
return Common::kNoError;
}

View file

@ -114,7 +114,7 @@ public:
void waitForVSync();
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;

View file

@ -662,10 +662,6 @@ bool Engine::canLoadGameStateCurrently() {
return false;
}
Common::Error Engine::saveGameState(int slot, const Common::String &desc) {
return saveGameState(slot, desc, false);
}
Common::Error Engine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::OutSaveFile *saveFile = _saveFileMan->openForSaving(getSaveStateName(slot));

View file

@ -257,14 +257,6 @@ public:
*/
virtual bool canLoadGameStateCurrently();
/**
* Save a game state.
* @param slot the slot into which the savestate should be stored
* @param desc a description for the savestate, entered by the user
* @return returns kNoError on success, else an error code.
*/
virtual Common::Error saveGameState(int slot, const Common::String &desc);
/**
* Save a game state.
* @param slot the slot into which the savestate should be stored
@ -272,7 +264,7 @@ public:
* @param isAutosave Expected to be true if an autosave is being created
* @return returns kNoError on success, else an error code.
*/
virtual Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave);
virtual Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false);
/**
* Save a game state.

View file

@ -239,7 +239,7 @@ Common::Error FullpipeEngine::loadGameState(int slot) {
return Common::kUnknownError;
}
Common::Error FullpipeEngine::saveGameState(int slot, const Common::String &description) {
Common::Error FullpipeEngine::saveGameState(int slot, const Common::String &description, bool isAutosave) {
if (_gameLoader->writeSavegame(_currentScene, getSavegameFile(slot), description))
return Common::kNoError;
else

View file

@ -356,7 +356,7 @@ public:
bool _isSaveAllowed;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &description) override;
Common::Error saveGameState(int slot, const Common::String &description, bool isAutosave = false) override;
bool canLoadGameStateCurrently() override { return true; }
bool canSaveGameStateCurrently() override { return _isSaveAllowed; }

View file

@ -129,7 +129,7 @@ Common::Error Frotz::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error Frotz::saveGameState(int slot, const Common::String &desc) {
Common::Error Frotz::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::String msg;
FileReference ref(slot, desc, fileusage_BinaryMode | fileusage_SavedGame);

View file

@ -79,7 +79,7 @@ public:
/**
* Save the game to a given slot
*/
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
/**
* Loading method not used for Frotz sub-engine

View file

@ -228,7 +228,7 @@ Common::Error GlkEngine::loadGameState(int slot) {
return errCode;
}
Common::Error GlkEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error GlkEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::String msg;
FileReference ref(slot, desc, fileusage_BinaryMode | fileusage_SavedGame);

View file

@ -201,7 +201,7 @@ public:
/**
* Save the game to a given slot
*/
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
/**
* Load a savegame from the passed Quetzal file chunk stream

View file

@ -315,7 +315,7 @@ public:
int readSavegameDescription(int savegameNum, Common::String &description);
int loadSavegame(int savegameNum);
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error loadGameState(int slot) override;
Common::String generateSaveName(int slot);
void synchronize(Common::Serializer &s);

View file

@ -527,7 +527,7 @@ void GnapEngine::updateMenuStatusMainMenu() {
#endif
}
Common::Error GnapEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error GnapEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::OutSaveFile *out = g_system->getSavefileManager()->openForSaving(
generateSaveName(slot));
if (!out)

View file

@ -417,7 +417,7 @@ private:
Common::String getSaveStateName(int slot) const override;
int loadPlayer(int slotnum);
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error loadGameStream(Common::SeekableReadStream *file) override;
Common::Error saveGameStream(Common::WriteStream *file, bool isAutosave) override;
void autoSaveCheck();

View file

@ -391,7 +391,7 @@ Common::Error GroovieEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error GroovieEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error GroovieEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
_script->directGameSave(slot,desc);
// TODO: Use specific error codes

View file

@ -105,7 +105,7 @@ protected:
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
void syncSoundSettings() override;
public:

View file

@ -195,7 +195,7 @@ public:
_changeLevel = true;
}
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;

View file

@ -36,7 +36,7 @@ bool HDBGame::canSaveGameStateCurrently() {
return (_gameState == GAME_PLAY && !_ai->cinematicsActive());
}
Common::Error HDBGame::saveGameState(int slot, const Common::String &desc) {
Common::Error HDBGame::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
// If no map is loaded, don't try to save
if (!g_hdb->_map->isLoaded())

View file

@ -106,7 +106,7 @@ Common::Error HopkinsEngine::loadGameState(int slot) {
/**
* Save the game to the given slot index, and with the given name
*/
Common::Error HopkinsEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error HopkinsEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
return _saveLoad->saveGame(slot, desc);
}

View file

@ -165,8 +165,10 @@ public:
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
int _startGameSlot;
/**
* Run the introduction sequence
*/

View file

@ -176,7 +176,7 @@ void HugoEngine::setMaxScore(const int newScore) {
_maxscore = newScore;
}
Common::Error HugoEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error HugoEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
return (_file->saveGame(slot, desc) ? Common::kWritingFailed : Common::kNoError);
}

View file

@ -283,7 +283,7 @@ public:
void adjustScore(const int adjustment);
int getMaxScore() const;
void setMaxScore(const int newScore);
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error loadGameState(int slot) override;
bool hasFeature(EngineFeature f) const override;
const char *getCopyrightString() const;

View file

@ -226,7 +226,7 @@ public:
bool canLoadGameStateCurrently() override { return _isSaveAllowed; }
bool canSaveGameStateCurrently() override { return _isSaveAllowed; }
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &description) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error removeGameState(int slot);
bool savegame(const char *filename, const char *description);
bool loadgame(const char *filename);

View file

@ -134,7 +134,7 @@ Common::Error IllusionsEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error IllusionsEngine::saveGameState(int slot, const Common::String &description) {
Common::Error IllusionsEngine::saveGameState(int slot, const Common::String &description, bool isAutosave) {
const char *fileName = getSavegameFilename(slot);
if (!savegame(fileName, description.c_str()))
return Common::kWritingFailed;

View file

@ -424,7 +424,9 @@ protected:
void loadGameStateCheck(int slot);
Common::Error loadGameState(int slot) override = 0;
Common::Error saveGameState(int slot, const Common::String &desc) override { return saveGameStateIntern(slot, desc.c_str(), 0); }
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override {
return saveGameStateIntern(slot, desc.c_str(), 0);
}
virtual Common::Error saveGameStateIntern(int slot, const char *saveName, const Graphics::Surface *thumbnail) = 0;
Common::SeekableReadStream *openSaveForReading(const char *filename, SaveHeader &header, bool checkID = true);

View file

@ -216,7 +216,7 @@ Common::Error LabEngine::loadGameState(int slot) {
return (result) ? Common::kNoError : Common::kUserCanceled;
}
Common::Error LabEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error LabEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
bool result = saveGame(slot, desc);
return (result) ? Common::kNoError : Common::kUserCanceled;
}

View file

@ -227,7 +227,7 @@ public:
void waitTOF();
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;

View file

@ -121,7 +121,7 @@ public:
Common::Error loadGameState(int slot) override {
return loadGame(slot) ? Common::kNoError : Common::kReadingFailed;
}
Common::Error saveGameState(int slot, const Common::String &desc) override {
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override {
Common::String s(desc);
return saveGame(slot, s) ? Common::kNoError : Common::kReadingFailed;
}

View file

@ -200,7 +200,7 @@ public:
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
void newGame();
void setInitialFlags();
void setNewGameState();

View file

@ -149,7 +149,7 @@ Common::Error MacVentureEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error MacVentureEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error MacVentureEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::String saveFileName = Common::String::format("%s.%03d", _targetName.c_str(), slot);
Common::SaveFileManager *manager = getSaveFileManager();
// HACK Get a real name!

View file

@ -215,7 +215,7 @@ Common::Error MADSEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error MADSEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error MADSEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
_game->saveGame(slot, desc);
return Common::kNoError;
}

View file

@ -150,7 +150,7 @@ public:
/**
* Handles saving the game via the GMM
*/
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
/**
* Handles updating sound settings after they're changed in the GMM dialog

View file

@ -968,7 +968,7 @@ Common::Error MohawkEngine_Myst::loadGameState(int slot) {
return Common::kUnknownError;
}
Common::Error MohawkEngine_Myst::saveGameState(int slot, const Common::String &desc) {
Common::Error MohawkEngine_Myst::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
const Graphics::Surface *thumbnail = nullptr;
if (_stack->getStackId() == kMenuStack) {
thumbnail = _gfx->getThumbnailForMainMenu();

View file

@ -188,7 +188,7 @@ public:
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
void tryAutoSaving();
bool hasFeature(EngineFeature f) const override;
static Common::Array<Common::Keymap *> initKeymaps(const char *target);

View file

@ -723,18 +723,14 @@ void MohawkEngine_Riven::loadGameStateAndDisplayError(int slot) {
}
}
Common::Error MohawkEngine_Riven::saveGameState(int slot, const Common::String &desc) {
return saveGameState(slot, desc, false);
}
Common::Error MohawkEngine_Riven::saveGameState(int slot, const Common::String &desc, bool autosave) {
Common::Error MohawkEngine_Riven::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
if (_menuSavedStack != -1) {
_vars["CurrentStackID"] = _menuSavedStack;
_vars["CurrentCardID"] = _menuSavedCard;
}
const Graphics::Surface *thumbnail = _menuSavedStack != -1 ? _menuThumbnail.get() : nullptr;
Common::Error error = _saveLoad->saveGame(slot, desc, thumbnail, autosave);
Common::Error error = _saveLoad->saveGame(slot, desc, thumbnail, isAutosave);
if (_menuSavedStack != -1) {
_vars["CurrentStackID"] = 1;

View file

@ -104,7 +104,7 @@ public:
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool hasFeature(EngineFeature f) const override;
static Common::Array<Common::Keymap *> initKeymaps(const char *target);
@ -168,7 +168,6 @@ public:
void runSaveDialog();
void tryAutoSaving();
void loadGameStateAndDisplayError(int slot);
Common::Error saveGameState(int slot, const Common::String &desc, bool autosave) override;
void saveGameStateAndDisplayError(int slot, const Common::String &desc);
/**

View file

@ -203,7 +203,7 @@ Common::Error MortevielleEngine::loadGameState(int slot) {
/**
* Save the current game
*/
Common::Error MortevielleEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error MortevielleEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
if (slot == 0)
return Common::kWritingFailed;

View file

@ -442,7 +442,7 @@ public:
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error run() override;
void pauseEngineIntern(bool pause) override;
uint32 getGameFlags() const;

View file

@ -147,7 +147,7 @@ bool MutationOfJBEngine::canSaveGameStateCurrently() {
return _game->loadSaveAllowed();
}
Common::Error MutationOfJBEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error MutationOfJBEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
const Common::String saveName = Common::String::format("%s.%03d", _targetName.c_str(), slot);
Common::OutSaveFile *const saveFile = g_system->getSavefileManager()->openForSaving(saveName);
if (!saveFile)

View file

@ -69,7 +69,7 @@ public:
bool canLoadGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
bool canSaveGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
const ADGameDescription *getGameDescription() const;

View file

@ -121,7 +121,7 @@ public:
bool canSaveGameStateCurrently() override { return _isSaveAllowed; }
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &description) override;
Common::Error saveGameState(int slot, const Common::String &description, bool isAutosave = false) override;
Common::Error removeGameState(int slot);
bool savegame(const char *filename, const char *description);
bool loadgame(const char *filename);

View file

@ -136,7 +136,7 @@ Common::Error NeverhoodEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error NeverhoodEngine::saveGameState(int slot, const Common::String &description) {
Common::Error NeverhoodEngine::saveGameState(int slot, const Common::String &description, bool isAutosave) {
const char *fileName = getSavegameFilename(slot);
if (!savegame(fileName, description.c_str()))
return Common::kWritingFailed;

View file

@ -696,7 +696,7 @@ static bool isValidSaveFileName(const Common::String &desc) {
return true;
}
Common::Error PegasusEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error PegasusEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
if (!isValidSaveFileName(desc))
return Common::Error(Common::kCreatingFileFailed, _("Invalid file name for saving"));

View file

@ -81,7 +81,7 @@ public:
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
static Common::Array<Common::Keymap *> initKeymaps();
// Base classes

View file

@ -99,7 +99,7 @@ public:
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
static void pauseEngine(void *engine, bool pause); // for MacWndMgr

View file

@ -49,7 +49,7 @@ Common::Error PinkEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error PinkEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error PinkEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::OutSaveFile *out = _saveFileMan->openForSaving(generateSaveName(slot, _targetName.c_str()));
if (!out)
return Common::kUnknownError;

View file

@ -285,7 +285,7 @@ public:
void pauseEngineIntern(bool pause) override;
bool canSaveGameStateCurrently() override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error loadGameState(int slot) override;
void playVideo(Common::String videoFilename);

View file

@ -144,7 +144,7 @@ bool PrinceEngine::canLoadGameStateCurrently() {
return false;
}
Common::Error PrinceEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error PrinceEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
// Set up the serializer
Common::String slotName = generateSaveName(slot);
Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(slotName);

View file

@ -182,7 +182,7 @@ bool QueenEngine::canSaveGameStateCurrently() {
return canLoadOrSave();
}
Common::Error QueenEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error QueenEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
debug(3, "Saving game to slot %d", slot);
char name[20];
Common::Error err = Common::kNoError;

View file

@ -96,7 +96,7 @@ public:
bool canLoadOrSave() const;
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error loadGameState(int slot) override;
void makeGameStateName(int slot, char *buf) const;
int getGameStateSlot(const char *filename) const;

View file

@ -334,7 +334,7 @@ Common::Error SagaEngine::loadGameState(int slot) {
return Common::kNoError; // TODO: return success/failure
}
Common::Error SagaEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error SagaEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
save(calcSaveFileName((uint)slot), desc.c_str());
return Common::kNoError; // TODO: return success/failure
}

View file

@ -628,7 +628,7 @@ public:
const Common::Rect &getDisplayClip() const { return _displayClip;}
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
const GameDisplayInfo &getDisplayInfo();

View file

@ -937,7 +937,7 @@ Common::Error SciEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error SciEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error SciEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::String fileName = Common::String::format("%s.%03d", _targetName.c_str(), slot);
Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
Common::OutSaveFile *out = saveFileMan->openForSaving(fileName);

View file

@ -260,7 +260,7 @@ public:
void severeError();
Console *getSciDebugger();
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;
void syncSoundSettings() override; ///< from ScummVM to the game

View file

@ -102,7 +102,7 @@ bool ScummEngine::canLoadGameStateCurrently() {
return (VAR_MAINMENU_KEY == 0xFF || VAR(VAR_MAINMENU_KEY) != 0);
}
Common::Error ScummEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error ScummEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
requestSave(slot, desc);
return Common::kNoError;
}

View file

@ -434,7 +434,7 @@ public:
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
void pauseEngineIntern(bool pause) override;

View file

@ -279,7 +279,7 @@ Common::Error SherlockEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error SherlockEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error SherlockEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
_saves->saveGame(slot, desc);
return Common::kNoError;
}

View file

@ -162,7 +162,7 @@ public:
/**
* Called by the GMM to save the game
*/
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
/**
* Called by the engine when sound settings are updated

View file

@ -317,7 +317,7 @@ Common::Error SkyEngine::loadGameState(int slot) {
return (result == GAME_RESTORED) ? Common::kNoError : Common::kUnknownError;
}
Common::Error SkyEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error SkyEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
if (slot == 0)
return Common::kWritePermissionDenied; // we can't overwrite the auto save

View file

@ -87,7 +87,7 @@ public:
static bool isCDVersion();
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canLoadGameStateCurrently() override;
bool canSaveGameStateCurrently() override;

View file

@ -666,7 +666,7 @@ bool SupernovaEngine::canSaveGameStateCurrently() {
return _allowSaveGame && _gm->canSaveGameStateCurrently();
}
Common::Error SupernovaEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error SupernovaEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
return (saveGame(slot, desc) ? Common::kNoError : Common::kWritingFailed);
}

View file

@ -67,7 +67,7 @@ public:
Common::Error run() override;
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
bool hasFeature(EngineFeature f) const override;
void pauseEngineIntern(bool pause) override;

View file

@ -366,7 +366,7 @@ bool SwordEngine::canLoadGameStateCurrently() {
return (mouseIsActive() && !_control->isPanelShown()); // Disable GMM loading when game panel is shown
}
Common::Error SwordEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error SwordEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
_control->setSaveDescription(slot, desc.c_str());
_control->saveGameToFile(slot);
return Common::kNoError; // TODO: return success/failure

View file

@ -110,7 +110,7 @@ protected:
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
private:

View file

@ -824,7 +824,7 @@ uint32 Sword2Engine::getMillis() {
return _system->getMillis();
}
Common::Error Sword2Engine::saveGameState(int slot, const Common::String &desc) {
Common::Error Sword2Engine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
uint32 saveVal = saveGame(slot, (const byte *)desc.c_str());
if (saveVal == SR_OK)

View file

@ -163,7 +163,7 @@ public:
void setSubtitles(bool b) { _useSubtitles = b; }
// GMM Loading/Saving
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently() override;
Common::Error loadGameState(int slot) override;
bool canLoadGameStateCurrently() override;

View file

@ -80,7 +80,7 @@ protected:
// void pauseEngineIntern(bool pause); // TODO: Implement this!!!
// void syncSoundSettings(); // TODO: Implement this!!!
// Common::Error loadGameState(int slot); // TODO: Implement this?
// Common::Error saveGameState(int slot, const Common::String &desc); // TODO: Implement this?
// Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false); // TODO: Implement this?
// bool canLoadGameStateCurrently(); // TODO: Implement this?
// bool canSaveGameStateCurrently(); // TODO: Implement this?

View file

@ -263,7 +263,7 @@ Common::Error TeenAgentEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error TeenAgentEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error TeenAgentEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
debug(0, "saving to slot %d", slot);
Common::ScopedPtr<Common::OutSaveFile> out(_saveFileMan->openForSaving(Common::String::format("teenagent.%02d", slot)));
if (!out)

View file

@ -88,7 +88,7 @@ public:
Common::Error run() override;
Common::Error loadGameState(int slot) override;
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canLoadGameStateCurrently() override { return true; }
bool canSaveGameStateCurrently() override { return !_sceneBusy; }
bool hasFeature(EngineFeature f) const override;

View file

@ -440,7 +440,7 @@ Common::Error TinselEngine::loadGameState(int slot) {
}
#if 0
Common::Error TinselEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error TinselEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::String saveName = _vm->getSavegameFilename((int16)(slot + 1));
char saveDesc[SG_DESC_LEN];
Common::strlcpy(saveDesc, desc, SG_DESC_LEN);

View file

@ -164,7 +164,7 @@ protected:
bool hasFeature(EngineFeature f) const override;
Common::Error loadGameState(int slot) override;
#if 0
Common::Error saveGameState(int slot, const Common::String &desc);
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false);
#endif
bool canLoadGameStateCurrently() override;
#if 0

View file

@ -231,7 +231,7 @@ Common::Error TitanicEngine::loadGameState(int slot) {
return Common::kNoError;
}
Common::Error TitanicEngine::saveGameState(int slot, const Common::String &desc) {
Common::Error TitanicEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
_window->_project->saveGame(slot, desc);
return Common::kNoError;
}

View file

@ -149,7 +149,7 @@ public:
/**
* Called by the GMM to save the game
*/
Common::Error saveGameState(int slot, const Common::String &desc) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
/**
* Handles updates to the sound levels

Some files were not shown because too many files have changed in this diff Show more