X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=e46b177553430e80ffb8fdac0ad6f0246d65921c;hb=5ed4de42ced8e7dce5b786ba3d5fd1a6f6a7d7f6;hp=53b8171422ab97d250b7f66508d5944fff877726;hpb=4ec434ee1acb955d0e2e8c33558e5f9226904174;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 53b81714..e46b1775 100644 --- a/src/events.c +++ b/src/events.c @@ -270,22 +270,24 @@ void HandleButton(int mx, int my, int button) { static int old_mx = 0, old_my = 0; - if (mx<0 || my<0) + if (button < 0) { mx = old_mx; my = old_my; + button = -button; } else { old_mx = mx; old_my = my; - HandleGadgets(mx,my, button); HandleVideoButtons(mx,my, button); HandleSoundButtons(mx,my, button); HandleGameButtons(mx,my, button); } + HandleGadgets(mx, my, button); + switch(game_status) { case MAINMENU: @@ -610,7 +612,7 @@ void HandleNoXEvent() { if (button_status && game_status != PLAYING) { - HandleButton(-1,-1, button_status); + HandleButton(0, 0, -button_status); return; } @@ -676,7 +678,8 @@ void HandleJoystick() { 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)