fixed and improved single step mode for all game engines
[rocksndiamonds.git] / src / tools.c
index 626cb8973a892c62612bf68454ebc6f488251ac7..d15f800e638e3534adc600d1db7b08694efcc5a7 100644 (file)
@@ -3759,6 +3759,10 @@ void WaitForEventToContinue()
       {
        case EVENT_BUTTONPRESS:
        case EVENT_KEYPRESS:
+#if defined(TARGET_SDL2)
+        case SDL_CONTROLLERBUTTONDOWN:
+#endif
+        case SDL_JOYBUTTONDOWN:
          still_wait = FALSE;
          break;
 
@@ -3912,7 +3916,11 @@ static int RequestHandleEvents(unsigned int req_state)
 
              case KSYM_Return:
 #if defined(TARGET_SDL2)
+             case KSYM_Select:
              case KSYM_Menu:
+#if defined(KSYM_Rewind)
+             case KSYM_Rewind:         /* for Amazon Fire TV remote */
+#endif
 #endif
                result = 1;
                break;
@@ -3920,6 +3928,9 @@ static int RequestHandleEvents(unsigned int req_state)
              case KSYM_Escape:
 #if defined(TARGET_SDL2)
              case KSYM_Back:
+#if defined(KSYM_FastForward)
+             case KSYM_FastForward:    /* for Amazon Fire TV remote */
+#endif
 #endif
                result = 0;
                break;
@@ -8359,8 +8370,15 @@ void CheckSingleStepMode_EM(byte action[MAX_PLAYERS], int frame,
 void CheckSingleStepMode_SP(boolean murphy_is_waiting,
                            boolean murphy_is_dropping)
 {
+  boolean murphy_starts_dropping = FALSE;
+  int i;
+
+  for (i = 0; i < MAX_PLAYERS; i++)
+    if (stored_player[i].force_dropping)
+      murphy_starts_dropping = TRUE;
+
   if (tape.single_step && tape.recording && !tape.pausing)
-    if (murphy_is_waiting)
+    if (murphy_is_waiting && !murphy_starts_dropping)
       TapeTogglePause(TAPE_TOGGLE_AUTOMATIC);
 
   CheckSaveEngineSnapshot_SP(murphy_is_waiting, murphy_is_dropping);