X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=a967230e3bb0f3d39c6bb2bb3341c0918a8e0a58;hb=2357c391b4a587709627cc30316734b3c83c8134;hp=dc398df7fe5870ab51767fb52292154ff615a649;hpb=1146572677fd6858df5fc1fabfd7f7294bdefed7;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index dc398df7..a967230e 100644 --- a/src/events.c +++ b/src/events.c @@ -189,7 +189,7 @@ void HandleExposeEvent(XExposeEvent *event) int x = event->x, y = event->y; int width = event->width, height = event->height; - if (setup.direct_draw_on && game_status==PLAYING) + if (setup.direct_draw && game_status==PLAYING) { int xx,yy; int x1 = (x-SX)/TILEX, y1 = (y-SY)/TILEY; @@ -206,7 +206,7 @@ void HandleExposeEvent(XExposeEvent *event) SetDrawtoField(DRAW_DIRECT); } - if (setup.soft_scrolling_on && game_status == PLAYING) + if (setup.soft_scrolling && game_status == PLAYING) { int fx = FX, fy = FY; @@ -409,14 +409,14 @@ void HandleKey(KeySym key, int key_status) if (key_status == KEY_PRESSED) { if (network_playing) - local_player->action |= key_action; + local_player->potential_action |= key_action; else stored_player[pnr].action |= key_action; } else { if (network_playing) - local_player->action &= ~key_action; + local_player->potential_action &= ~key_action; else stored_player[pnr].action &= ~key_action; } @@ -720,6 +720,10 @@ void HandleKey(KeySym key, int key_status) local_player->dynamite = 1000; break; + + +#if 0 + case XK_x: { @@ -775,8 +779,6 @@ void HandleKey(KeySym key, int key_status) break; - -#if 0 case XK_y: /* { @@ -792,11 +794,9 @@ void HandleKey(KeySym key, int key_status) } */ - printf("direct_draw_on == %d\n", setup.direct_draw_on); + printf("direct_draw == %d\n", setup.direct_draw); break; -#endif - case XK_z: { @@ -828,6 +828,7 @@ void HandleKey(KeySym key, int key_status) } break; +#endif #endif default: @@ -876,9 +877,34 @@ void HandleNoXEvent() } } +static int HandleJoystickForAllPlayers() +{ + int i; + int result = 0; + + for (i=0; ipotential_action |= joy_action; + else + stored_player[i].action |= joy_action; + } + + return result; +} + void HandleJoystick() { - int joystick = Joystick(); + int joystick = HandleJoystickForAllPlayers(); int keyboard = key_joystick_mapping; int joy = (joystick | keyboard); int left = joy & JOY_LEFT; @@ -886,7 +912,7 @@ void HandleJoystick() int up = joy & JOY_UP; int down = joy & JOY_DOWN; int button = joy & JOY_BUTTON; - int newbutton = (JoystickButton() == JOY_BUTTON_NEW_PRESSED); + int newbutton = (AnyJoystickButton() == JOY_BUTTON_NEW_PRESSED); int dx = (left ? -1 : right ? 1 : 0); int dy = (up ? -1 : down ? 1 : 0); @@ -934,16 +960,6 @@ void HandleJoystick() return; } - /* - if (tape.pausing || AllPlayersGone) - { - int i; - - for (i=0; i