X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=78f76fd8ce8f577f9ffdbc921a7964e24f7592da;hb=93e2747358fef77db481b9f36e4d088e6441899e;hp=5c1f6549daee1d533f5e27333abf84f8d79e97cb;hpb=064971ae82e2e3f98dc55e75b15c192c9165fb4e;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 5c1f6549..78f76fd8 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1065,8 +1065,8 @@ void getSizedGraphicSourceExt(int graphic, int frame, int tilesize, } *bitmap = src_bitmap; - *x = src_x * tilesize / TILESIZE; - *y = src_y * tilesize / TILESIZE; + *x = src_x * tilesize / g->tile_size; + *y = src_y * tilesize / g->tile_size; } void getFixedGraphicSourceExt(int graphic, int frame, Bitmap **bitmap, @@ -1127,6 +1127,9 @@ inline static void getGraphicSourceExt(int graphic, int frame, Bitmap **bitmap, *x = src_x + frame * g->offset_x; *y = src_y + frame * g->offset_y; } + + *x = *x * TILESIZE_VAR / g->tile_size; + *y = *y * TILESIZE_VAR / g->tile_size; } void getGraphicSource(int graphic, int frame, Bitmap **bitmap, int *x, int *y) @@ -1236,13 +1239,12 @@ void DrawGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, int graphic, void DrawFixedGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, int graphic, int frame) { - struct GraphicInfo *g = &graphic_info[graphic]; Bitmap *src_bitmap; int src_x, src_y; getFixedGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y); - BlitBitmapMasked(src_bitmap, d, src_x, src_y, g->width, g->height, + BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dst_x, dst_y); }