added using special editor graphics for scanned BD elements
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 27 Aug 2024 21:56:03 +0000 (23:56 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Wed, 28 Aug 2024 14:31:34 +0000 (16:31 +0200)
If additional editor graphics are defined for certain BD elements,
also use these graphics for scanned BD elements in the level editor
(which always use the graphics of their non-scanned counterparts).

src/tools.c

index c28d8acaca699c7babc89535301d15c32f0af051..d94e5e0dbce6670cd418f4af6aa9d7f6bea5060a 100644 (file)
@@ -10500,6 +10500,15 @@ int el2edimg(int element)
 
 int el2edimg_with_frame(int element, int *graphic, int *frame)
 {
+  // make sure to use special editor graphics for scanned elements, if available
+  if (IS_BDX_SCANNED_ELEMENT(element))
+  {
+    int element_bd_scanned = map_element_RND_to_BD_cave(element);
+    int element_bd_unscanned = getNonScannedElement_BD(element_bd_scanned);
+
+    element = map_element_BD_to_RND_cave(element_bd_unscanned);
+  }
+
   *graphic = el2edimg(element);
   *frame = 0;