aboutsummaryrefslogtreecommitdiff
path: root/engines/adl/hires1.cpp
diff options
context:
space:
mode:
authorWalter van Niftrik2016-03-02 11:38:01 +0100
committerWalter van Niftrik2016-03-09 10:03:13 +0100
commit93f5e36c9f9a75a2fa939408a76b0a2632c09425 (patch)
tree452ae58cf0500086b2af6f4675f44ef540d5566a /engines/adl/hires1.cpp
parent339d3bc86813b454447b02481f82b85c4c8be75b (diff)
downloadscummvm-rg350-93f5e36c9f9a75a2fa939408a76b0a2632c09425.tar.gz
scummvm-rg350-93f5e36c9f9a75a2fa939408a76b0a2632c09425.tar.bz2
scummvm-rg350-93f5e36c9f9a75a2fa939408a76b0a2632c09425.zip
ADL: Add GMM loading and saving
Diffstat (limited to 'engines/adl/hires1.cpp')
-rw-r--r--engines/adl/hires1.cpp50
1 files changed, 35 insertions, 15 deletions
diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp
index 591216698b..db69a2d863 100644
--- a/engines/adl/hires1.cpp
+++ b/engines/adl/hires1.cpp
@@ -371,29 +371,49 @@ void HiRes1Engine::runGame() {
printASCIIString("\r\r\r\r\r");
while (1) {
- if (_isRestarting)
- _isRestarting = false;
-
uint verb = 0, noun = 0;
- clearScreen();
- showRoom();
- getInput(verb, noun);
- if (!doOneCommand(_roomCommands, verb, noun))
- printMessage(37);
+ // When restoring from the launcher, we don't read
+ // input on the first iteration. This is needed to
+ // ensure that restoring from the launcher and
+ // restoring in-game brings us to the same game state.
+ // (Also see comment below.)
+ if (!_isRestoring) {
+ clearScreen();
+ showRoom();
- if (_isRestarting)
- continue;
+ _canSaveNow = _canRestoreNow = true;
+ getInput(verb, noun);
+ _canSaveNow = _canRestoreNow = false;
- doAllCommands(_globalCommands, verb, noun);
+ if (shouldQuit())
+ return;
+
+ if (!doOneCommand(_roomCommands, verb, noun))
+ printMessage(IDI_HR1_MSG_DONT_UNDERSTAND);
+ }
- if (_isRestarting)
+ if (_isRestoring) {
+ // We restored from the GMM or launcher. As restoring
+ // with "RESTORE GAME" does not end command processing,
+ // we don't break it off here either. This essentially
+ // means that restoring a game will always run through
+ // the global commands and increase the move counter
+ // before the first user input.
+ printASCIIString("\r");
+ _isRestoring = false;
+ verb = _restoreVerb;
+ noun = _restoreNoun;
+ }
+
+ // Restarting does end command processing
+ if (_isRestarting) {
+ _isRestarting = false;
continue;
+ }
+ doAllCommands(_globalCommands, verb, noun);
_state.moves++;
-
- if (shouldQuit())
- return;
}
}