X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=750e0fa846948a1776a980a4c681bb53fcb89f67;hb=2402812951920ad4af5ac7a3cb52c9a4e8b4d75a;hp=721f4afe78e8e660381d31edddf6c5801051bdae;hpb=dc9fe7359bd0b8dea49f46b9fb2e59f006200a63;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index 721f4afe..750e0fa8 100644 --- a/src/editor.c +++ b/src/editor.c @@ -7359,7 +7359,25 @@ static void ScrollEditorLevel(int from_x, int from_y, int scroll) static void getEditorGraphicSource(int element, int tile_size, Bitmap **bitmap, int *x, int *y) { - getSizedGraphicSource(el2edimg(element), 0, tile_size, bitmap, x, y); + int graphic = el2edimg(element); + int frame = 0; + + if (graphic == IMG_UNKNOWN) + { + // no graphic defined -- if BD style, try to get runtime ("effect") element graphics + // (normal BD style elements have graphics, but runtime ("effects") elements do not) + int element_bd = map_element_RND_to_BD_cave(element); + + if (element_bd != O_UNKNOWN) + { + struct GraphicInfo_BD *g_bd = &graphic_info_bd_object[element_bd][0]; + + graphic = g_bd->graphic; + frame = g_bd->frame; + } + } + + getSizedGraphicSource(graphic, frame, tile_size, bitmap, x, y); } static void CreateControlButtons(void)