moved code for buttons to stop game or tape to separate functions
[rocksndiamonds.git] / src / tape.c
index 68ffadcf92677d6d126deb3075b6b5e1f417fdeb..d93c6632a97e7f2112db654aec44c700f6987b6a 100644 (file)
@@ -1088,6 +1088,27 @@ void TapeStop(void)
   }
 }
 
+static void TapeStopGameOrTape(boolean stop_game)
+{
+  if (!tape.playing && stop_game)
+    RequestQuitGame(FALSE);
+  else
+    TapeStop();
+}
+
+void TapeStopGame(void)
+{
+  if (game_status == GAME_MODE_MAIN)
+    return;
+
+  TapeStopGameOrTape(TRUE);
+}
+
+void TapeStopTape(void)
+{
+  TapeStopGameOrTape(FALSE);
+}
+
 unsigned int GetTapeLengthFrames(void)
 {
   unsigned int tape_length_frames = 0;
@@ -2393,7 +2414,7 @@ static void HandleTapeButtonsExt(int id)
       break;
 
     case TAPE_CTRL_ID_STOP:
-      TapeStop();
+      TapeStopTape();
 
       break;