diff options
author | Paul Gilbert | 2019-06-08 21:39:52 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-06-09 15:00:46 -0700 |
commit | a9324c3c9e0eea017f899faf7b2a53039b659ae5 (patch) | |
tree | c86b8a90ccbc1983df38239b615f0afaeffce40b /engines/glk/advsys/advsys.cpp | |
parent | da434f29522d7ee36f33c1b0bd95d9cc03cc5093 (diff) | |
download | scummvm-rg350-a9324c3c9e0eea017f899faf7b2a53039b659ae5.tar.gz scummvm-rg350-a9324c3c9e0eea017f899faf7b2a53039b659ae5.tar.bz2 scummvm-rg350-a9324c3c9e0eea017f899faf7b2a53039b659ae5.zip |
GLK: ADVSYS: Main game loop
Diffstat (limited to 'engines/glk/advsys/advsys.cpp')
-rw-r--r-- | engines/glk/advsys/advsys.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/engines/glk/advsys/advsys.cpp b/engines/glk/advsys/advsys.cpp index 5d0f20b1bb..c1d1f9e38e 100644 --- a/engines/glk/advsys/advsys.cpp +++ b/engines/glk/advsys/advsys.cpp @@ -26,14 +26,49 @@ namespace Glk { namespace AdvSys { +void execute(int offset) { + // TODO: Stub +} + +bool getInput() { + // TODO: Stub + return false; +} + +bool singleAction() { + // TODO: Stub + return false; +} + +bool nextAction() { + // TODO: STub + return false; +} + void AdvSys::runGame() { if (!initialize()) { GUIErrorMessage(_("Could not start AdvSys game")); return; } - // TODO: play game - print("ADVINT v1.2 - Copyright (c) 1986, by David Betz\n"); + // Outer play loop - this loop re-iterates if a game is restarted + while (!shouldQuit()) { + // Run game startup + execute(_initCodeOffset); + + // Gameplay loop + while (!shouldQuit() && !shouldRestart()) { + // Run update code + execute(_updateCodeOffset); + + // Get and parse a single line + if (getInput()) { + if (singleAction()) { + while (!shouldQuit() && nextAction() && singleAction()) {} + } + } + } + } deinitialize(); } |