X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;fp=src%2Feditor.c;h=60f12d409993f93f18003ca2cd4d8f2694987fec;hb=2a695902d9c7fde7f6d8f271dfc97bf6f9674542;hp=6ec52ee30ac21c4100f3120c80d7c9d733b53696;hpb=90863c926554302e589b60a85a3468b31292c4ff;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index 6ec52ee3..60f12d40 100644 --- a/src/editor.c +++ b/src/editor.c @@ -5399,7 +5399,6 @@ static boolean getDrawModeHiRes(void); static int getTabulatorBarWidth(void); static int getTabulatorBarHeight(void); static Pixel getTabulatorBarColor(void); -static void getEditorGraphicAndFrame(int, int *, int *, boolean); static int numHiresTiles(int); static int num_editor_gadgets = 0; // dynamically determined @@ -8057,7 +8056,7 @@ static void DrawDrawingArea(int id) int graphic; int frame; - getEditorGraphicAndFrame(element, &graphic, &frame, TRUE); + el2edimg_with_frame(element, &graphic, &frame); DrawSizedGraphicExt(drawto, gi->x + x * tilesize, @@ -8098,29 +8097,13 @@ static void ScrollEditorLevel(int from_x, int from_y, int scroll) BackToFront(); } -static void getEditorGraphicAndFrame(int element, int *graphic, int *frame, boolean use_editor_gfx) -{ - if (use_editor_gfx) - { - el2edimg_with_frame(element, graphic, frame); - } - else - { - *graphic = el2img(element); - *frame = (ANIM_MODE(*graphic) == ANIM_CE_VALUE ? - custom_element.ce_value_fixed_initial : - ANIM_MODE(*graphic) == ANIM_CE_SCORE ? - custom_element.collect_score_initial : FrameCounter); - } -} - static void getEditorGraphicSource(int element, int tile_size, Bitmap **bitmap, int *x, int *y) { int graphic; int frame; - getEditorGraphicAndFrame(element, &graphic, &frame, TRUE); + el2edimg_with_frame(element, &graphic, &frame); getSizedGraphicSource(graphic, frame, tile_size, bitmap, x, y); } @@ -13064,13 +13047,17 @@ static void DrawEditorElementAnimation(int x, int y) if (IS_BD_RUNTIME_ELEMENT(properties_element)) { - getEditorGraphicAndFrame(properties_element, &graphic, &frame, TRUE); + el2edimg_with_frame(properties_element, &graphic, &frame); DrawFixedGraphicExt(drawto, x, y, graphic, frame); } else { - getEditorGraphicAndFrame(properties_element, &graphic, &frame, FALSE); + graphic = el2img(properties_element); + frame = (ANIM_MODE(graphic) == ANIM_CE_VALUE ? + custom_element.ce_value_fixed_initial : + ANIM_MODE(graphic) == ANIM_CE_SCORE ? + custom_element.collect_score_initial : FrameCounter); DrawFixedGraphicAnimationExt(drawto, x, y, graphic, frame, NO_MASKING); }