added centering levels that are smaller than the playfield (MM engine)
[rocksndiamonds.git] / src / tape.c
index abec7013f7b809c05a1eb6d29798b02a999e1c74..447ce12c92367faa1ff10491ac8761d450fe693b 100644 (file)
@@ -544,6 +544,8 @@ void TapeErase()
 
   tape.centered_player_nr_next = -1;
   tape.set_centered_player = FALSE;
+
+  tape.use_mouse = (level.game_engine_type == GAME_ENGINE_TYPE_MM);
 }
 
 static void TapeRewind()
@@ -596,18 +598,7 @@ void TapeStartRecording(int random_seed)
 
 static void TapeStartGameRecording()
 {
-  TapeStartRecording(level.random_seed);
-
-#if defined(NETWORK_AVALIABLE)
-  if (options.network)
-  {
-    SendToServer_StartPlaying();
-
-    return;
-  }
-#endif
-
-  InitGame();
+  StartGameActions(options.network, TRUE, level.random_seed);
 }
 
 static void TapeAppendRecording()
@@ -709,7 +700,7 @@ void TapeRecordAction(byte action_raw[MAX_PLAYERS])
   for (i = 0; i < MAX_PLAYERS; i++)
     action[i] = action_raw[i];
 
-  if (tape.set_centered_player)
+  if (!tape.use_mouse && tape.set_centered_player)
   {
     for (i = 0; i < MAX_PLAYERS; i++)
       if (tape.centered_player_nr_next == i ||
@@ -887,16 +878,19 @@ byte *TapePlayAction()
   tape.set_centered_player = FALSE;
   tape.centered_player_nr_next = -999;
 
-  for (i = 0; i < MAX_PLAYERS; i++)
+  if (!tape.use_mouse)
   {
-    if (action[i] & KEY_SET_FOCUS)
+    for (i = 0; i < MAX_PLAYERS; i++)
     {
-      tape.set_centered_player = TRUE;
-      tape.centered_player_nr_next =
-       (tape.centered_player_nr_next == -999 ? i : -1);
-    }
+      if (action[i] & KEY_SET_FOCUS)
+      {
+       tape.set_centered_player = TRUE;
+       tape.centered_player_nr_next =
+         (tape.centered_player_nr_next == -999 ? i : -1);
+      }
 
-    action[i] &= ~KEY_SET_FOCUS;
+      action[i] &= ~KEY_SET_FOCUS;
+    }
   }
 
   tape.delay_played++;
@@ -1351,7 +1345,7 @@ void MapTapeButtons()
     MapTapeWarpButton();
 
   if (tape.show_game_buttons)
-    MapGameButtons();
+    MapGameButtonsOnTape();
 }
 
 void UnmapTapeButtons()
@@ -1362,7 +1356,7 @@ void UnmapTapeButtons()
     UnmapGadget(tape_gadget[i]);
 
   if (tape.show_game_buttons)
-    UnmapGameButtons();
+    UnmapGameButtonsOnTape();
 }
 
 void RedrawTapeButtons()
@@ -1373,7 +1367,7 @@ void RedrawTapeButtons()
     RedrawGadget(tape_gadget[i]);
 
   if (tape.show_game_buttons)
-    RedrawGameButtons();
+    RedrawGameButtonsOnTape();
 
   // RedrawGadget() may have set REDRAW_ALL if buttons are defined off-area
   redraw_mask &= ~REDRAW_ALL;