X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=6ec52ee30ac21c4100f3120c80d7c9d733b53696;hb=5934610dc0048580758ec4b9c2d2a9c75e3a2615;hp=f21d086ea693aa6a9225d11f7c9eb4c787d2a0ae;hpb=d0e4766613f1c5b5685900eb4376ff73bf8581d3;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index f21d086e..6ec52ee3 100644 --- a/src/editor.c +++ b/src/editor.c @@ -8102,8 +8102,7 @@ static void getEditorGraphicAndFrame(int element, int *graphic, int *frame, bool { if (use_editor_gfx) { - *graphic = el2edimg(element); - *frame = 0; + el2edimg_with_frame(element, graphic, frame); } else { @@ -8113,21 +8112,6 @@ static void getEditorGraphicAndFrame(int element, int *graphic, int *frame, bool ANIM_MODE(*graphic) == ANIM_CE_SCORE ? custom_element.collect_score_initial : FrameCounter); } - - 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; - } - } } static void getEditorGraphicSource(int element, int tile_size, Bitmap **bitmap, @@ -13078,9 +13062,18 @@ static void DrawEditorElementAnimation(int x, int y) int graphic; int frame; - getEditorGraphicAndFrame(properties_element, &graphic, &frame, FALSE); + if (IS_BD_RUNTIME_ELEMENT(properties_element)) + { + getEditorGraphicAndFrame(properties_element, &graphic, &frame, TRUE); + + DrawFixedGraphicExt(drawto, x, y, graphic, frame); + } + else + { + getEditorGraphicAndFrame(properties_element, &graphic, &frame, FALSE); - DrawFixedGraphicAnimationExt(drawto, x, y, graphic, frame, NO_MASKING); + DrawFixedGraphicAnimationExt(drawto, x, y, graphic, frame, NO_MASKING); + } } static void DrawEditorElementName(int x, int y, int font_nr)