aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2009-02-19 18:40:03 +0000
committerPaweł Kołodziejski2009-02-19 18:40:03 +0000
commit7beba8edc996cedb956fd8a689980cbbeb38bcb4 (patch)
tree494e594e70d20661eef99f18b899b44a1793c719
parentc6e9e3d9bc2d33d03aadff65e128c94e721707c8 (diff)
downloadscummvm-rg350-7beba8edc996cedb956fd8a689980cbbeb38bcb4.tar.gz
scummvm-rg350-7beba8edc996cedb956fd8a689980cbbeb38bcb4.tar.bz2
scummvm-rg350-7beba8edc996cedb956fd8a689980cbbeb38bcb4.zip
formating
svn-id: r38558
-rw-r--r--engines/sci/engine/kevent.cpp72
1 files changed, 25 insertions, 47 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 9a25b2b93e..d1a8214f13 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -29,29 +29,27 @@ int stop_on_event;
#define SCI_VARIABLE_GAME_SPEED 3
-reg_t
-kGetEvent(state_t *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kGetEvent(state_t *s, int funct_nr, int argc, reg_t *argv) {
int mask = UKPV(0);
reg_t obj = argv[1];
sci_event_t e;
int oldx, oldy;
- int modifier_mask = SCI_VERSION_MAJOR(s->version) == 0 ? SCI_EVM_ALL
- : SCI_EVM_NO_FOOLOCK;
+ int modifier_mask = SCI_VERSION_MAJOR(s->version) == 0 ? SCI_EVM_ALL : SCI_EVM_NO_FOOLOCK;
if (s->kernel_opt_flags & KERNEL_OPT_FLAG_GOT_2NDEVENT) {
- /* Penalty time- too many requests to this function without
- ** waiting! */
+ // Penalty time- too many requests to this function without
+ // waiting!
int delay = s->script_000->locals_block->locals[SCI_VARIABLE_GAME_SPEED].offset;
gfxop_usleep(s->gfx_state, (1000000 * delay) / 60);
}
- /*If there's a simkey pending, and the game wants a keyboard event, use the
- *simkey instead of a normal event*/
+ // If there's a simkey pending, and the game wants a keyboard event, use the
+ // simkey instead of a normal event
if (_kdebug_cheap_event_hack && (mask & SCI_EVT_KEYBOARD)) {
- PUT_SEL32V(obj, type, SCI_EVT_KEYBOARD); /*Keyboard event*/
+ PUT_SEL32V(obj, type, SCI_EVT_KEYBOARD); // Keyboard event
PUT_SEL32V(obj, message, _kdebug_cheap_event_hack);
- PUT_SEL32V(obj, modifiers, SCI_EVM_NUMLOCK); /*Numlock on*/
+ PUT_SEL32V(obj, modifiers, SCI_EVM_NUMLOCK); // Numlock on
PUT_SEL32V(obj, x, s->gfx_state->pointer_pos.x);
PUT_SEL32V(obj, y, s->gfx_state->pointer_pos.y);
_kdebug_cheap_event_hack = 0;
@@ -62,17 +60,15 @@ kGetEvent(state_t *s, int funct_nr, int argc, reg_t *argv) {
oldy = s->gfx_state->pointer_pos.y;
e = gfxop_get_event(s->gfx_state, mask);
- s->parser_event = NULL_REG; /* Invalidate parser event */
+ s->parser_event = NULL_REG; // Invalidate parser event
PUT_SEL32V(obj, x, s->gfx_state->pointer_pos.x);
PUT_SEL32V(obj, y, s->gfx_state->pointer_pos.y);
- /* gfxop_set_pointer_position(s->gfx_state, Common::Point(s->gfx_state->pointer_pos.x, s->gfx_state->pointer_pos.y)); */
-
+ //gfxop_set_pointer_position(s->gfx_state, Common::Point(s->gfx_state->pointer_pos.x, s->gfx_state->pointer_pos.y));
if (e.type)
- s->kernel_opt_flags &= ~(KERNEL_OPT_FLAG_GOT_EVENT
- | KERNEL_OPT_FLAG_GOT_2NDEVENT);
+ s->kernel_opt_flags &= ~(KERNEL_OPT_FLAG_GOT_EVENT | KERNEL_OPT_FLAG_GOT_2NDEVENT);
else {
if (s->kernel_opt_flags & KERNEL_OPT_FLAG_GOT_EVENT)
s->kernel_opt_flags |= KERNEL_OPT_FLAG_GOT_2NDEVENT;
@@ -86,35 +82,25 @@ kGetEvent(state_t *s, int funct_nr, int argc, reg_t *argv) {
break;
case SCI_EVT_KEYBOARD: {
-
- if ((e.buckybits & SCI_EVM_LSHIFT) && (e.buckybits & SCI_EVM_RSHIFT)
- && (e.data == '-')) {
-
+ if ((e.buckybits & SCI_EVM_LSHIFT) && (e.buckybits & SCI_EVM_RSHIFT) && (e.data == '-')) {
sciprintf("Debug mode activated\n");
-
- script_debug_flag = 1; /* Enter debug mode */
+ script_debug_flag = 1; // Enter debug mode
_debug_seeking = _debug_step_running = 0;
s->onscreen_console = 0;
-
} else if ((e.buckybits & SCI_EVM_CTRL) && (e.data == '`')) {
-
- script_debug_flag = 1; /* Enter debug mode */
+ script_debug_flag = 1; // Enter debug mode
_debug_seeking = _debug_step_running = 0;
s->onscreen_console = 1;
-
} else if ((e.buckybits & SCI_EVM_CTRL) && (e.data == '1')) {
-
if (s->visual)
s->visual->print(GFXW(s->visual), 0);
-
} else {
- PUT_SEL32V(obj, type, SCI_EVT_KEYBOARD); /*Keyboard event*/
+ PUT_SEL32V(obj, type, SCI_EVT_KEYBOARD); // Keyboard event
s->r_acc = make_reg(0, 1);
PUT_SEL32V(obj, message, e.character);
- /* We only care about the translated
- ** character */
+ // We only care about the translated
+ // character
PUT_SEL32V(obj, modifiers, e.buckybits&modifier_mask);
-
}
}
break;
@@ -143,7 +129,7 @@ kGetEvent(state_t *s, int funct_nr, int argc, reg_t *argv) {
break;
default: {
- s->r_acc = NULL_REG; /* Unknown or no event */
+ s->r_acc = NULL_REG; // Unknown or no event
}
}
@@ -155,11 +141,10 @@ kGetEvent(state_t *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
-reg_t
-kMapKeyToDir(state_t *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kMapKeyToDir(state_t *s, int funct_nr, int argc, reg_t *argv) {
reg_t obj = argv[0];
- if (GET_SEL32V(obj, type) == SCI_EVT_KEYBOARD) { /* Keyboard */
+ if (GET_SEL32V(obj, type) == SCI_EVT_KEYBOARD) { // Keyboard
int mover = -1;
switch (GET_SEL32V(obj, message)) {
case SCI_K_HOME:
@@ -204,10 +189,8 @@ kMapKeyToDir(state_t *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
-
-reg_t
-kGlobalToLocal(state_t *s, int funct_nr, int argc, reg_t *argv) {
- reg_t obj = argc ? argv[0] : NULL_REG; /* Can this really happen? Lars */
+reg_t kGlobalToLocal(state_t *s, int funct_nr, int argc, reg_t *argv) {
+ reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
if (obj.segment) {
int x = GET_SEL32V(obj, x);
@@ -221,10 +204,8 @@ kGlobalToLocal(state_t *s, int funct_nr, int argc, reg_t *argv) {
}
-
-reg_t
-kLocalToGlobal(state_t *s, int funct_nr, int argc, reg_t *argv) {
- reg_t obj = argc ? argv[0] : NULL_REG; /* Can this really happen? Lars */
+reg_t kLocalToGlobal(state_t *s, int funct_nr, int argc, reg_t *argv) {
+ reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
if (obj.segment) {
int x = GET_SEL32V(obj, x);
@@ -237,10 +218,7 @@ kLocalToGlobal(state_t *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
-reg_t /* Not implemented */
-kJoystick(state_t *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kJoystick(state_t *s, int funct_nr, int argc, reg_t *argv) {
SCIkdebug(SCIkSTUB, "Unimplemented syscall 'Joystick()'\n", funct_nr);
return NULL_REG;
}
-
-