aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-03-08 21:54:07 +0000
committerMax Horn2010-03-08 21:54:07 +0000
commit38bf3d0d3c468cf5a51bf5d5e7393ffcad68eea1 (patch)
tree9485c6908c7f9f89ad68c3ac5c67a9ab707726ac
parent688288ec7dd558170bbcf7298dde501faafe0a47 (diff)
downloadscummvm-rg350-38bf3d0d3c468cf5a51bf5d5e7393ffcad68eea1.tar.gz
scummvm-rg350-38bf3d0d3c468cf5a51bf5d5e7393ffcad68eea1.tar.bz2
scummvm-rg350-38bf3d0d3c468cf5a51bf5d5e7393ffcad68eea1.zip
SCI: Make EngineState parameter to INV_SEL explicit
svn-id: r48202
-rw-r--r--engines/sci/engine/klists.cpp2
-rw-r--r--engines/sci/engine/kmovement.cpp14
-rw-r--r--engines/sci/engine/kparse.cpp4
-rw-r--r--engines/sci/engine/selector.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index f9bccb06e3..c04454ca3d 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -442,7 +442,7 @@ reg_t kSort(EngineState *s, int argc, reg_t *argv) {
i = 0;
while (node) {
- invoke_selector(INV_SEL(order_func, doit, kStopOnInvalidSelector), 1, node->value);
+ invoke_selector(INV_SEL(s, order_func, doit, kStopOnInvalidSelector), 1, node->value);
temp_array[i].key = node->key;
temp_array[i].value = node->value;
temp_array[i].order = s->r_acc;
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index 1dd3227aef..fcaf0d7ea0 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -316,10 +316,10 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) {
debugC(2, kDebugLevelBresen, "New data: (x,y)=(%d,%d), di=%d", x, y, bdi);
if (g_sci->getKernel()->_selectorCache.cantBeHere != -1) {
- invoke_selector(INV_SEL(client, cantBeHere, kStopOnInvalidSelector), 0);
+ invoke_selector(INV_SEL(s, client, cantBeHere, kStopOnInvalidSelector), 0);
s->r_acc = make_reg(0, !s->r_acc.offset);
} else {
- invoke_selector(INV_SEL(client, canBeHere, kStopOnInvalidSelector), 0);
+ invoke_selector(INV_SEL(s, client, canBeHere, kStopOnInvalidSelector), 0);
}
if (!s->r_acc.offset) { // Contains the return value
@@ -336,7 +336,7 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) {
// FIXME: find out why iceman needs this and we ask for version > SCI01
if ((getSciVersion() > SCI_VERSION_01) || (s->_gameId == "iceman"))
if (completed)
- invoke_selector(INV_SEL(mover, moveDone, kStopOnInvalidSelector), 0);
+ invoke_selector(INV_SEL(s, mover, moveDone, kStopOnInvalidSelector), 0);
return make_reg(0, completed);
}
@@ -400,7 +400,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) {
debugC(2, kDebugLevelBresen, "Doing avoider %04x:%04x (dest=%d,%d)", PRINT_REG(avoider), destx, desty);
- if (invoke_selector(INV_SEL(mover, doit, kContinueOnInvalidSelector) , 0)) {
+ if (invoke_selector(INV_SEL(s, mover, doit, kContinueOnInvalidSelector) , 0)) {
error("Mover %04x:%04x of avoider %04x:%04x doesn't have a doit() funcselector", PRINT_REG(mover), PRINT_REG(avoider));
return NULL_REG;
}
@@ -409,7 +409,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) {
if (!mover.segment) // Mover has been disposed?
return s->r_acc; // Return gracefully.
- if (invoke_selector(INV_SEL(client, isBlocked, kContinueOnInvalidSelector) , 0)) {
+ if (invoke_selector(INV_SEL(s, client, isBlocked, kContinueOnInvalidSelector) , 0)) {
error("Client %04x:%04x of avoider %04x:%04x doesn't"
" have an isBlocked() funcselector", PRINT_REG(client), PRINT_REG(avoider));
return NULL_REG;
@@ -440,7 +440,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) {
debugC(2, kDebugLevelBresen, "Pos (%d,%d): Trying angle %d; delta=(%d,%d)", oldx, oldy, angle, move_x, move_y);
- if (invoke_selector(INV_SEL(client, canBeHere, kContinueOnInvalidSelector) , 0)) {
+ if (invoke_selector(INV_SEL(s, client, canBeHere, kContinueOnInvalidSelector) , 0)) {
error("Client %04x:%04x of avoider %04x:%04x doesn't"
" have a canBeHere() funcselector", PRINT_REG(client), PRINT_REG(avoider));
return NULL_REG;
@@ -474,7 +474,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) {
s->r_acc = make_reg(0, angle);
if (looper.segment) {
- if (invoke_selector(INV_SEL(looper, doit, kContinueOnInvalidSelector), 2, angle, client)) {
+ if (invoke_selector(INV_SEL(s, looper, doit, kContinueOnInvalidSelector), 2, angle, client)) {
error("Looper %04x:%04x of avoider %04x:%04x doesn't"
" have a doit() funcselector", PRINT_REG(looper), PRINT_REG(avoider));
} else
diff --git a/engines/sci/engine/kparse.cpp b/engines/sci/engine/kparse.cpp
index 6901274575..0254d21642 100644
--- a/engines/sci/engine/kparse.cpp
+++ b/engines/sci/engine/kparse.cpp
@@ -117,7 +117,7 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) {
s->r_acc = make_reg(0, 1);
PUT_SEL32V(segMan, event, SELECTOR(claimed), 1);
- invoke_selector(INV_SEL(s->_gameObj, syntaxFail, kStopOnInvalidSelector), 2, s->_voc->parser_base, stringpos);
+ invoke_selector(INV_SEL(s, s->_gameObj, syntaxFail, kStopOnInvalidSelector), 2, s->_voc->parser_base, stringpos);
/* Issue warning */
debugC(2, kDebugLevelParser, "Tree building failed");
@@ -140,7 +140,7 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) {
debugC(2, kDebugLevelParser, "Word unknown: %s", error);
/* Issue warning: */
- invoke_selector(INV_SEL(s->_gameObj, wordFail, kStopOnInvalidSelector), 2, s->_voc->parser_base, stringpos);
+ invoke_selector(INV_SEL(s, s->_gameObj, wordFail, kStopOnInvalidSelector), 2, s->_voc->parser_base, stringpos);
free(error);
return make_reg(0, 1); /* Tell them that it didn't work */
}
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h
index e824d8713d..70eeb34d93 100644
--- a/engines/sci/engine/selector.h
+++ b/engines/sci/engine/selector.h
@@ -78,7 +78,7 @@ enum SelectorInvocation {
* Kludge for use with invoke_selector(). Used for compatibility with compilers
* that cannot handle vararg macros.
*/
-#define INV_SEL(_object_, _selector_, _noinvalid_) \
+#define INV_SEL(s, _object_, _selector_, _noinvalid_) \
s, _object_, g_sci->getKernel()->_selectorCache._selector_, _noinvalid_, argc, argv