aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/jumps.h
diff options
context:
space:
mode:
authorPaul Gilbert2019-09-24 20:20:35 -0700
committerPaul Gilbert2019-09-25 20:13:28 -0700
commit043093209ee3ff8a00b76885f7624ff349aff839 (patch)
treeb8dd604edc670342c4eaaa8ccbe3bedb39bcb11b /engines/glk/jumps.h
parent97686a7c030a685146bdb10e32f6cd8e4eb52d1e (diff)
downloadscummvm-rg350-043093209ee3ff8a00b76885f7624ff349aff839.tar.gz
scummvm-rg350-043093209ee3ff8a00b76885f7624ff349aff839.tar.bz2
scummvm-rg350-043093209ee3ff8a00b76885f7624ff349aff839.zip
GLK: ALAN3: Merge duplicate jumps.h
Diffstat (limited to 'engines/glk/jumps.h')
-rw-r--r--engines/glk/jumps.h14
1 files changed, 14 insertions, 0 deletions
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