X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=bde987901f8b4181c824ae673faa4cde114aea90;hb=51cc8f17af487cc53aafccf050ff1b16fec878a9;hp=c849dd3fe0b25bc49ce71a0ef3b6789ee6000972;hpb=be4120e388ba1c192713e675144136ea644fa712;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index c849dd3f..bde98790 100644 --- a/src/tools.c +++ b/src/tools.c @@ -512,6 +512,10 @@ static void DrawMaskedBorderExt_Rect(int x, int y, int width, int height, Bitmap *src_bitmap = getGlobalBorderBitmapFromStatus(global.border_status); Bitmap *dst_bitmap = gfx.masked_border_bitmap_ptr; + // may happen for "border.draw_masked.*" with undefined "global.border.*" + if (src_bitmap == NULL) + return; + if (x == -1 && y == -1) return; @@ -1507,10 +1511,12 @@ int getGraphicAnimationFrameXY(int graphic, int lx, int ly) return sync_frame % g->anim_frames; } + else + { + int sync_frame = (IN_LEV_FIELD(lx, ly) ? GfxFrame[lx][ly] : -1); - int sync_frame = (IN_LEV_FIELD(lx, ly) ? GfxFrame[lx][ly] : -1); - - return getGraphicAnimationFrame(graphic, sync_frame); + return getGraphicAnimationFrame(graphic, sync_frame); + } } void getGraphicSourceBitmap(int graphic, int tilesize, Bitmap **bitmap) @@ -2521,6 +2527,11 @@ void DrawScreenGraphic(int x, int y, int graphic, int frame) } } +void DrawLevelGraphic(int x, int y, int graphic, int frame) +{ + DrawScreenGraphic(SCREENX(x), SCREENY(y), graphic, frame); +} + void DrawScreenElement(int x, int y, int element) { int mask_mode = NO_MASKING;