replaced code by using function with same functionality
authorHolger Schemel <info@artsoft.org>
Wed, 10 Apr 2024 16:54:18 +0000 (18:54 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 10 Apr 2024 16:54:18 +0000 (18:54 +0200)
src/editor.c

index 7566391988dbcdb635f32465cdab4ad98fe0afd2..b3304f7befcbc15ad8ba4f598b80937dcee33189 100644 (file)
@@ -10602,30 +10602,10 @@ static void InitDrawingElements(void)
   if (level.game_engine_type == game_engine_type_last)
     return;
 
-  if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
-  {
-    new_element1 = EL_BD_WALL;
-    new_element2 = EL_EMPTY;
-    new_element3 = EL_BD_SAND;
-  }
-  else 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;
-  }
+  // select drawing elements according to game engine type
+  new_element1 = getDrawingElement(EL_WALL);
+  new_element2 = getDrawingElement(EL_EMPTY);
+  new_element3 = getDrawingElement(EL_SAND);
 
   game_engine_type_last = level.game_engine_type;
 }