X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=7888e606efb015b7d738e2ddf4b60c7984a400db;hb=dce27fe1c087a26e6dac4ef6367012c51810f327;hp=4df35c22201c2a10b7d2b13f3f3a4fbf7cf4fbf2;hpb=6279921cda22181d9ca97cc65fdfe832ee699be0;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 4df35c22..7888e606 100644 --- a/src/tools.c +++ b/src/tools.c @@ -744,7 +744,13 @@ static void DrawGraphicAnimationShiftedThruMask(int sx, int sy, void getGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) { - if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN) + if (graphic >= 0 && graphic_info[graphic].bitmap != NULL) + { + *bitmap = graphic_info[graphic].bitmap; + *x = graphic_info[graphic].src_x; + *y = graphic_info[graphic].src_y; + } + else if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN) { graphic -= GFX_START_ROCKSSCREEN; *bitmap = pix[PIX_BACK]; @@ -2713,9 +2719,11 @@ int el2gfx_OLD(int element) int el2gfx(int element) { - int graphic_OLD = el2gfx_OLD(element); int graphic_NEW = element_info[element].graphic; +#if DEBUG + int graphic_OLD = el2gfx_OLD(element); + if (element >= MAX_ELEMENTS) { Error(ERR_WARN, "el2gfx: element == %d >= MAX_ELEMENTS", element); @@ -2726,6 +2734,7 @@ int el2gfx(int element) Error(ERR_WARN, "el2gfx: graphic_NEW (%d) != graphic_OLD (%d)", graphic_NEW, graphic_OLD); } +#endif return graphic_NEW; }