From f86618f92be1350bf6e56573c2419e604c811548 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 5 Feb 2010 22:55:18 +0000 Subject: SCI: Add a 'SELECTOR' macro svn-id: r47918 --- engines/sci/engine/kevent.cpp | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'engines/sci/engine/kevent.cpp') diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 2f7a6e1068..3099c87ff4 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -53,11 +53,11 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { // If there's a simkey pending, and the game wants a keyboard event, use the // simkey instead of a normal event if (g_debug_simulated_key && (mask & SCI_EVENT_KEYBOARD)) { - PUT_SEL32V(segMan, obj, type, SCI_EVENT_KEYBOARD); // Keyboard event - PUT_SEL32V(segMan, obj, message, g_debug_simulated_key); - PUT_SEL32V(segMan, obj, modifiers, SCI_KEYMOD_NUMLOCK); // Numlock on - PUT_SEL32V(segMan, obj, x, mousePos.x); - PUT_SEL32V(segMan, obj, y, mousePos.y); + PUT_SEL32V(segMan, obj, SELECTOR(type), SCI_EVENT_KEYBOARD); // Keyboard event + PUT_SEL32V(segMan, obj, SELECTOR(message), g_debug_simulated_key); + PUT_SEL32V(segMan, obj, SELECTOR(modifiers), SCI_KEYMOD_NUMLOCK); // Numlock on + PUT_SEL32V(segMan, obj, SELECTOR(x), mousePos.x); + PUT_SEL32V(segMan, obj, SELECTOR(y), mousePos.y); g_debug_simulated_key = 0; return make_reg(0, 1); } @@ -69,8 +69,8 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { if (s->_voc) s->_voc->parser_event = NULL_REG; // Invalidate parser event - PUT_SEL32V(segMan, obj, x, mousePos.x); - PUT_SEL32V(segMan, obj, y, mousePos.y); + PUT_SEL32V(segMan, obj, SELECTOR(x), mousePos.x); + PUT_SEL32V(segMan, obj, SELECTOR(y), mousePos.y); //s->_gui->moveCursor(s->gfx_state->pointer_pos.x, s->gfx_state->pointer_pos.y); @@ -80,12 +80,12 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { break; case SCI_EVENT_KEYBOARD: - PUT_SEL32V(segMan, obj, type, SCI_EVENT_KEYBOARD); // Keyboard event + PUT_SEL32V(segMan, obj, SELECTOR(type), SCI_EVENT_KEYBOARD); // Keyboard event s->r_acc = make_reg(0, 1); - PUT_SEL32V(segMan, obj, message, curEvent.character); + PUT_SEL32V(segMan, obj, SELECTOR(message), curEvent.character); // We only care about the translated character - PUT_SEL32V(segMan, obj, modifiers, curEvent.modifiers & modifier_mask); + PUT_SEL32V(segMan, obj, SELECTOR(modifiers), curEvent.modifiers & modifier_mask); break; case SCI_EVENT_MOUSE_RELEASE: @@ -110,9 +110,9 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { break; } - PUT_SEL32V(segMan, obj, type, curEvent.type); - PUT_SEL32V(segMan, obj, message, 0); - PUT_SEL32V(segMan, obj, modifiers, (curEvent.modifiers | extra_bits) & modifier_mask); + PUT_SEL32V(segMan, obj, SELECTOR(type), curEvent.type); + PUT_SEL32V(segMan, obj, SELECTOR(message), 0); + PUT_SEL32V(segMan, obj, SELECTOR(modifiers), (curEvent.modifiers | extra_bits) & modifier_mask); s->r_acc = make_reg(0, 1); } break; @@ -164,9 +164,9 @@ reg_t kMapKeyToDir(EngineState *s, int argc, reg_t *argv) { reg_t obj = argv[0]; SegManager *segMan = s->_segMan; - if (GET_SEL32V(segMan, obj, type) == SCI_EVENT_KEYBOARD) { // Keyboard + if (GET_SEL32V(segMan, obj, SELECTOR(type)) == SCI_EVENT_KEYBOARD) { // Keyboard int mover = -1; - switch (GET_SEL32V(segMan, obj, message)) { + switch (GET_SEL32V(segMan, obj, SELECTOR(message))) { case SCI_KEY_HOME: mover = 8; break; @@ -200,8 +200,8 @@ reg_t kMapKeyToDir(EngineState *s, int argc, reg_t *argv) { } if (mover >= 0) { - PUT_SEL32V(segMan, obj, type, SCI_EVENT_JOYSTICK); - PUT_SEL32V(segMan, obj, message, mover); + PUT_SEL32V(segMan, obj, SELECTOR(type), SCI_EVENT_JOYSTICK); + PUT_SEL32V(segMan, obj, SELECTOR(message), mover); return make_reg(0, 1); } else return NULL_REG; @@ -216,13 +216,13 @@ reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv) { SegManager *segMan = s->_segMan; if (obj.segment) { - int16 x = GET_SEL32V(segMan, obj, x); - int16 y = GET_SEL32V(segMan, obj, y); + int16 x = GET_SEL32V(segMan, obj, SELECTOR(x)); + int16 y = GET_SEL32V(segMan, obj, SELECTOR(y)); s->_gfxCoordAdjuster->kernelGlobalToLocal(x, y, planeObject); - PUT_SEL32V(segMan, obj, x, x); - PUT_SEL32V(segMan, obj, y, y); + PUT_SEL32V(segMan, obj, SELECTOR(x), x); + PUT_SEL32V(segMan, obj, SELECTOR(y), y); } return s->r_acc; @@ -235,13 +235,13 @@ reg_t kLocalToGlobal(EngineState *s, int argc, reg_t *argv) { SegManager *segMan = s->_segMan; if (obj.segment) { - int16 x = GET_SEL32V(segMan, obj, x); - int16 y = GET_SEL32V(segMan, obj, y); + int16 x = GET_SEL32V(segMan, obj, SELECTOR(x)); + int16 y = GET_SEL32V(segMan, obj, SELECTOR(y)); s->_gfxCoordAdjuster->kernelLocalToGlobal(x, y, planeObject); - PUT_SEL32V(segMan, obj, x, x); - PUT_SEL32V(segMan, obj, y, y); + PUT_SEL32V(segMan, obj, SELECTOR(x), x); + PUT_SEL32V(segMan, obj, SELECTOR(y), y); } return s->r_acc; -- cgit v1.2.3