X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=a967230e3bb0f3d39c6bb2bb3341c0918a8e0a58;hb=2357c391b4a587709627cc30316734b3c83c8134;hp=5fd56c0be23b556247a511e3621118d75428daec;hpb=d7d97176a88ee47f893055480c76b9c05a253d05;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 5fd56c0b..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; } @@ -794,7 +794,7 @@ 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; @@ -877,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; @@ -887,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); @@ -935,16 +960,6 @@ void HandleJoystick() return; } - /* - if (tape.pausing || AllPlayersGone) - { - int i; - - for (i=0; i