diff options
author | Gregory Montoir | 2004-12-02 21:24:27 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-12-02 21:24:27 +0000 |
commit | 891970cd767760cbb682319d3215786d4a651c08 (patch) | |
tree | 8adaca7e1b4a6774079c191b2cb36feaea743a06 /queen/queen.cpp | |
parent | 39de0960ff0ecfd6b71a4add447600e565c08d44 (diff) | |
download | scummvm-rg350-891970cd767760cbb682319d3215786d4a651c08.tar.gz scummvm-rg350-891970cd767760cbb682319d3215786d4a651c08.tar.bz2 scummvm-rg350-891970cd767760cbb682319d3215786d4a651c08.zip |
enabled autosave
svn-id: r15970
Diffstat (limited to 'queen/queen.cpp')
-rw-r--r-- | queen/queen.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/queen/queen.cpp b/queen/queen.cpp index a2780ce7dc..97c5e5b8b2 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -182,6 +182,10 @@ void QueenEngine::update(bool checkPlayerInput) { _input->quickLoadReset(); loadGameState(0); } + if (_system->getMillis() - _lastSaveTime > AUTOSAVE_INTERVAL) { + saveGameState(AUTOSAVE_SLOT, "Autosave"); + _lastSaveTime = _system->getMillis(); + } if (checkPlayerInput) { _command->updatePlayer(); } @@ -265,7 +269,11 @@ SaveFile *QueenEngine::readGameStateHeader(uint16 slot, GameStateHeader *gsh) { } void QueenEngine::makeGameStateName(uint16 slot, char *buf) { - sprintf(buf, "queen.s%02d", slot); + if (slot == AUTOSAVE_SLOT) { + strcpy(buf, "queen.asd"); + } else { + sprintf(buf, "queen.s%02d", slot); + } } void QueenEngine::findGameStateDescriptions(char descriptions[100][32]) { @@ -293,6 +301,7 @@ int QueenEngine::go() { if (ConfMan.hasKey("save_slot") && !(_resource->isDemo() || _resource->isInterview())) { loadGameState(ConfMan.getInt("save_slot")); } + _lastSaveTime = _system->getMillis(); _quit = false; while (!_quit) { // queen.c lines 4080-4104 |