rnd-19990107-2
[rocksndiamonds.git] / src / editor.c
index d92e27781d48dbf20e0e95667e1a2917854e249c..1265f4f72def1379441a5bd44af6991018146391 100644 (file)
@@ -18,6 +18,7 @@
 #include "buttons.h"
 #include "files.h"
 #include "game.h"
+#include "tape.h"
 
 /* positions in the level editor */
 #define ED_WIN_MB_LEFT_XPOS    7
@@ -909,6 +910,8 @@ void DrawLevelEd()
 
   CloseDoor(DOOR_CLOSE_ALL);
 
+  OpenDoor(DOOR_OPEN_2 | DOOR_NO_DELAY);
+
   if (level_editor_test_game)
   {
     for(x=0; x<lev_fieldx; x++)
@@ -1671,7 +1674,9 @@ void LevelEd(int mx, int my, int button)
 
            for(y=0;y<lev_fieldy;y++) 
              for(x=0;x<lev_fieldx;x++)
-               if (Feld[x][y]==EL_SPIELFIGUR || Feld[x][y]==EL_SPIELER1) 
+               if (Feld[x][y] == EL_SPIELFIGUR ||
+                   Feld[x][y] == EL_SPIELER1 ||
+                   Feld[x][y] == EL_SP_MURPHY) 
                  figur_vorhanden = TRUE;
 
            if (!figur_vorhanden)
@@ -2928,7 +2933,9 @@ static void HandleControlButtons(struct GadgetInfo *gi)
 
       for(y=0; y<lev_fieldy; y++) 
        for(x=0; x<lev_fieldx; x++)
-         if (Feld[x][y] == EL_SPIELFIGUR || Feld[x][y] == EL_SPIELER1) 
+         if (Feld[x][y] == EL_SPIELFIGUR ||
+             Feld[x][y] == EL_SPIELER1 ||
+             Feld[x][y] == EL_SP_MURPHY) 
            player_present = TRUE;
 
       if (!player_present)
@@ -2948,7 +2955,9 @@ static void HandleControlButtons(struct GadgetInfo *gi)
     case ED_CTRL_ID_TEST:
       for(y=0; y<lev_fieldy; y++) 
        for(x=0; x<lev_fieldx; x++)
-         if (Feld[x][y] == EL_SPIELFIGUR || Feld[x][y] == EL_SPIELER1) 
+         if (Feld[x][y] == EL_SPIELFIGUR ||
+             Feld[x][y] == EL_SPIELER1 ||
+             Feld[x][y] == EL_SP_MURPHY) 
            player_present = TRUE;
 
       if (!player_present)
@@ -2963,8 +2972,25 @@ static void HandleControlButtons(struct GadgetInfo *gi)
          for(y=0; y<lev_fieldy; y++)
            Ur[x][y] = Feld[x][y];
 
+       UnmapLevelEditorGadgets();
+
+       /* 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_ALL);
+
+       DrawCompleteVideoDisplay();
+
+       if (setup.autorecord)
+         TapeStartRecording();
+
        level_editor_test_game = TRUE;
        game_status = PLAYING;
+
        InitGame();
       }
       break;