From 043093209ee3ff8a00b76885f7624ff349aff839 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 24 Sep 2019 20:20:35 -0700 Subject: GLK: ALAN3: Merge duplicate jumps.h --- engines/glk/jumps.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'engines/glk/jumps.h') diff --git a/engines/glk/jumps.h b/engines/glk/jumps.h index f3438128f4..6da1a45041 100644 --- a/engines/glk/jumps.h +++ b/engines/glk/jumps.h @@ -23,6 +23,8 @@ #ifndef GLK_JUMPS #define GLK_JUMPS +#include "common/str.h" + /* This provides a simplified version of the ScummVM coroutines to allow for automated * breakouts to the main game loop from subroutinese rather than using unportable setjmps */ @@ -34,7 +36,17 @@ namespace Glk { */ struct Context { bool _break; + Common::String _label; + Context() : _break(false) {} + + /** + * Clear the context + */ + void clear() { + _break = false; + _label = ""; + } }; #define CALL0(METHOD) { METHOD(context); if (context._break) return; } @@ -62,6 +74,8 @@ struct Context { #define CONTEXT Context &context #define LONG_JUMP { context._break = true; return; } #define LONG_JUMP0 { context._break = true; return 0; } +#define LONG_JUMP_LABEL(LBL) { context._break = true; context._label = LBL; return; } +#define LONG_JUMP_LABEL0(LBL) { context._break = true; context._label = LBL; return 0; } } // End of namespace Glk -- cgit v1.2.3