aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan3/location.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-07-01 20:56:55 -0700
committerPaul Gilbert2019-07-06 15:27:09 -0700
commit5dea66231397c52afc7d2cdeae5989fd5edd0604 (patch)
tree6cd65d939d4051f0d0bade793f4598485547ad47 /engines/glk/alan3/location.cpp
parent18566feefcb9f4fa4d7395ffa6e6f2a6f0247d0e (diff)
downloadscummvm-rg350-5dea66231397c52afc7d2cdeae5989fd5edd0604.tar.gz
scummvm-rg350-5dea66231397c52afc7d2cdeae5989fd5edd0604.tar.bz2
scummvm-rg350-5dea66231397c52afc7d2cdeae5989fd5edd0604.zip
GLK: ALAN3: Wrapping method calls in longjmp replacement macros
Diffstat (limited to 'engines/glk/alan3/location.cpp')
-rw-r--r--engines/glk/alan3/location.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/engines/glk/alan3/location.cpp b/engines/glk/alan3/location.cpp
index 13076b4937..51c34f959d 100644
--- a/engines/glk/alan3/location.cpp
+++ b/engines/glk/alan3/location.cpp
@@ -39,51 +39,56 @@ namespace Glk {
namespace Alan3 {
/*----------------------------------------------------------------------*/
-static void traceExit(int location, int dir, const char *what) {
+static void traceExit(CONTEXT, int location, int dir, const char *what) {
printf("\n<EXIT %s[%d] from ",
(char *)pointerTo(dictionary[playerWords[currentWordIndex - 1].code].string), dir);
- traceSay(location);
+ CALL1(traceSay, location)
printf("[%d], %s:>\n", location, what);
}
/*======================================================================*/
-void go(int location, int dir) {
+void go(CONTEXT, int location, int dir) {
ExitEntry *theExit;
bool ok;
Aword oldloc;
theExit = (ExitEntry *) pointerTo(instances[location].exits);
- if (instances[location].exits != 0)
+ if (instances[location].exits != 0) {
while (!isEndOfArray(theExit)) {
if (theExit->code == (uint)dir) {
ok = TRUE;
if (theExit->checks != 0) {
if (traceSectionOption)
- traceExit(location, dir, "Checking");
- ok = !checksFailed(theExit->checks, EXECUTE_CHECK_BODY_ON_FAIL);
+ CALL3(traceExit, location, dir, "Checking")
+
+ FUNC2(checksFailed, ok, theExit->checks, EXECUTE_CHECK_BODY_ON_FAIL)
+ ok = !ok;
}
if (ok) {
oldloc = location;
if (theExit->action != 0) {
if (traceSectionOption)
- traceExit(location, dir, "Executing");
- interpret(theExit->action);
+ CALL3(traceExit, location, dir, "Executing")
+ CALL1(interpret, theExit->action)
}
/* Still at the same place? */
if (where(HERO, TRANSITIVE) == (int)oldloc) {
if (traceSectionOption)
- traceExit(location, dir, "Moving");
- locate(HERO, theExit->target);
+ CALL3(traceExit, location, dir, "Moving")
+ CALL2(locate, HERO, theExit->target)
}
return;
- } else
- error(NO_MSG);
+ } else {
+ CALL1(error, NO_MSG)
+ }
}
theExit++;
}
- error(M_NO_WAY);
+ }
+
+ CALL1(error, M_NO_WAY)
}
@@ -103,7 +108,7 @@ bool exitto(int to, int from) {
/*======================================================================*/
-void look(void) {
+void look(CONTEXT) {
uint i;
/* Set describe flag for all objects and actors */
@@ -114,13 +119,13 @@ void look(void) {
para();
setSubHeaderStyle();
- sayInstance(current.location);
+ CALL1(sayInstance, current.location)
setNormalStyle();
newline();
capitalize = TRUE;
- if (describe(current.location))
- describeInstances();
+ if (describe(context, current.location) && !context._break)
+ describeInstances(context);
}
} // End of namespace Alan3