rnd-19981216-1
[rocksndiamonds.git] / src / events.c
index 2fe47e4de408086cd4b5d5cc7e1a8c0923c8830d..38f58f940148d45c43783061b548f1e26605f98a 100644 (file)
@@ -429,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;
@@ -666,7 +676,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)