diff options
author | Torbjörn Andersson | 2006-04-18 18:23:57 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-04-18 18:23:57 +0000 |
commit | 6b034b66d8e95512a56bb5e3da083e8995bc5718 (patch) | |
tree | 71563a444b296e8e9643c33ae34777fd2c7651fe | |
parent | 40b74d5182f962652759ccfe4cd346a3de7889b0 (diff) | |
download | scummvm-rg350-6b034b66d8e95512a56bb5e3da083e8995bc5718.tar.gz scummvm-rg350-6b034b66d8e95512a56bb5e3da083e8995bc5718.tar.bz2 scummvm-rg350-6b034b66d8e95512a56bb5e3da083e8995bc5718.zip |
Added support for the --save-slot option for Broken Sword 1. (Feature request
#1460977.)
svn-id: r22009
-rw-r--r-- | engines/sword1/control.h | 2 | ||||
-rw-r--r-- | engines/sword1/sword1.cpp | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/engines/sword1/control.h b/engines/sword1/control.h index b1f81165be..912ccf8f72 100644 --- a/engines/sword1/control.h +++ b/engines/sword1/control.h @@ -83,11 +83,11 @@ public: void doRestore(void); void askForCd(void); bool savegamesExist(void); + bool restoreGameFromFile(uint8 slot); private: int displayMessage(const char *altButton, const char *message, ...); void saveGameToFile(uint8 slot); - bool restoreGameFromFile(uint8 slot); void readSavegameDescriptions(void); void writeSavegameDescriptions(void); void showSavegameNames(void); diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index b88713eda1..0d610d5251 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -445,19 +445,23 @@ void SwordEngine::checkCdFiles(void) { // check if we're running from cd, hdd or } int SwordEngine::go() { - uint16 startPos = ConfMan.getInt("boot_param"); - if (startPos) + if (startPos) { _logic->startPositions(startPos); - else { - if (_control->savegamesExist()) { + } else { + int saveSlot = ConfMan.getInt("save_slot"); + if (_control->restoreGameFromFile(saveSlot - 1)) { + _control->doRestore(); + } else if (_control->savegamesExist()) { _systemVars.controlPanelMode = CP_NEWGAME; if (_control->runPanel() == CONTROL_GAME_RESTORED) _control->doRestore(); else if (!_systemVars.engineQuit) _logic->startPositions(0); - } else // no savegames, start new game. + } else { + // no savegames, start new game. _logic->startPositions(0); + } } _systemVars.controlPanelMode = CP_NORMAL; |