added setting correct editor drawing elements (depending on game engine)
authorHolger Schemel <info@artsoft.org>
Mon, 6 Nov 2017 00:21:54 +0000 (01:21 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:15 +0000 (23:21 +0100)
src/editor.c

index 702646426b6a0d5ba9a652c9d20578295366d98f..7a854200d554445d7c48545c228b303777795d49 100644 (file)
@@ -8302,6 +8302,35 @@ void InitZoomLevelSettings(int zoom_tilesize)
   MAX_ED_FIELDY = getMaxEdFieldY(FALSE);
 }
 
+static void InitDrawingElements()
+{
+  static int game_engine_type_last = GAME_ENGINE_TYPE_UNKNOWN;
+
+  if (level.game_engine_type == game_engine_type_last)
+    return;
+
+  if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
+  {
+    new_element1 = EL_SP_CHIP_SINGLE;
+    new_element2 = EL_EMPTY;
+    new_element3 = EL_SP_BASE;
+  }
+  else if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+  {
+    new_element1 = EL_MM_MIRROR_START;
+    new_element2 = EL_EMPTY;
+    new_element3 = EL_MM_WOODEN_WALL;
+  }
+  else
+  {
+    new_element1 = EL_WALL;
+    new_element2 = EL_EMPTY;
+    new_element3 = EL_SAND;
+  }
+
+  game_engine_type_last = level.game_engine_type;
+}
+
 static void InitLevelSetInfo()
 {
   snprintf(levelset_name,   MAX_LEVEL_NAME_LEN + 1,
@@ -8403,6 +8432,7 @@ void DrawLevelEd()
   ClearField();
 
   InitZoomLevelSettings(-1);
+  InitDrawingElements();
   InitLevelSetInfo();
 
 #if DEBUG