diff options
| author | Paul Gilbert | 2019-06-12 22:26:06 -0700 | 
|---|---|---|
| committer | Paul Gilbert | 2019-06-12 22:26:06 -0700 | 
| commit | 06ffbab3c5450632de367bbea5a1a47fdc4300ff (patch) | |
| tree | 570c12cbf23ae7569ef9491cd1cb18f043662bc2 | |
| parent | 86126974096e14ff54aaa75fbb9cd5e4b9b5420d (diff) | |
| download | scummvm-rg350-06ffbab3c5450632de367bbea5a1a47fdc4300ff.tar.gz scummvm-rg350-06ffbab3c5450632de367bbea5a1a47fdc4300ff.tar.bz2 scummvm-rg350-06ffbab3c5450632de367bbea5a1a47fdc4300ff.zip  | |
GLK: ADVSYS: Added singleAction method
| -rw-r--r-- | engines/glk/advsys/advsys.cpp | 28 | ||||
| -rw-r--r-- | engines/glk/advsys/advsys.h | 5 | 
2 files changed, 27 insertions, 6 deletions
diff --git a/engines/glk/advsys/advsys.cpp b/engines/glk/advsys/advsys.cpp index 3f50d84237..26f298dd00 100644 --- a/engines/glk/advsys/advsys.cpp +++ b/engines/glk/advsys/advsys.cpp @@ -26,12 +26,6 @@  namespace Glk {  namespace AdvSys { -bool singleAction() { -	// TODO: Stub -	return false; -} - -  void AdvSys::runGame() {  	if (!initialize()) {  		GUIErrorMessage(_("Could not start AdvSys game")); @@ -75,6 +69,28 @@ bool AdvSys::initialize() {  void AdvSys::deinitialize() {  } +bool AdvSys::singleAction() { +	// Do the before code +	switch (execute(_beforeOffset)) { +	case ABORT: +		// Script aborted +		return false; +	case CHAIN: +		// Execute the action handler +		if (execute(getActionField(getVariable(V_ACTION), A_CODE)) == ABORT) +			return false; + +		// fall through +	case FINISH: +		// Do the after code +		if (execute(_afterOffset) == ABORT) +			return false; +		break; +	} + +	return true; +} +  Common::Error AdvSys::loadGameData(strid_t save) {  	return Common::kNoError;  } diff --git a/engines/glk/advsys/advsys.h b/engines/glk/advsys/advsys.h index 50977a6a3a..688a8fe094 100644 --- a/engines/glk/advsys/advsys.h +++ b/engines/glk/advsys/advsys.h @@ -43,6 +43,11 @@ private:  	 * Engine cleanup  	 */  	void deinitialize(); + +	/** +	 * Handle a single action +	 */ +	bool singleAction();  public:  	/**  	 * Constructor  | 
