X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=38f58f940148d45c43783061b548f1e26605f98a;hb=c5728b1ebc2a1d3753a6eea5a0f6335d077eef6b;hp=8d1de10daab05453a25e881a39f478064d1b3681;hpb=0a87fde47bcff35f196024766f8d0d00319a28d1;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 8d1de10d..38f58f94 100644 --- a/src/events.c +++ b/src/events.c @@ -20,6 +20,7 @@ #include "misc.h" #include "tape.h" #include "joystick.h" +#include "buttons.h" #include "network.h" /* values for key_status */ @@ -279,6 +280,7 @@ void HandleButton(int mx, int my, int button) old_mx = mx; old_my = my; + HandleGadgets(mx,my, button); HandleVideoButtons(mx,my, button); HandleSoundButtons(mx,my, button); HandleGameButtons(mx,my, button); @@ -427,7 +429,17 @@ void HandleKey(KeySym key, int key_status) /* allow quick escape to the main menu with the Escape key */ if (key == XK_Escape && game_status != MAINMENU) { - CloseDoor(DOOR_CLOSE_1 | DOOR_NO_DELAY); + if (game_status == LEVELED) + { + /* draw smaller door */ + XCopyArea(display, pix[PIX_DOOR], drawto, gc, + DOOR_GFX_PAGEX7, 64, + 108, 64, + EX - 4, EY - 12); + redraw_mask |= REDRAW_ALL; + } + + CloseDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY); game_status = MAINMENU; DrawMainMenu(); return; @@ -622,12 +634,19 @@ static int HandleJoystickForAllPlayers() { byte joy_action = 0; + /* if (!setup.input[i].use_joystick) continue; + */ joy_action = Joystick(i); result |= joy_action; + + if (!setup.input[i].use_joystick) + continue; + + stored_player[i].action = joy_action; } @@ -655,9 +674,10 @@ void HandleJoystick() case SETUP: case SETUPINPUT: { - static long joystickmove_delay = 0; + static unsigned long joystickmove_delay = 0; - if (joystick && !button && !DelayReached(&joystickmove_delay, 150)) + if (joystick && !button && + !DelayReached(&joystickmove_delay, GADGET_FRAME_DELAY)) newbutton = dx = dy = 0; if (game_status==MAINMENU)