From: Holger Schemel Date: Sun, 20 Dec 2015 17:53:39 +0000 (+0100) Subject: fixed bugs when using element graphics with non-standard tile size X-Git-Tag: 4.0.0.0-rc1~109 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=45bfdb3c0aed7513d056425e6f0abcdc0dc21867 fixed bugs when using element graphics with non-standard tile size --- diff --git a/src/init.c b/src/init.c index 3a2ccca2..ca820886 100644 --- a/src/init.c +++ b/src/init.c @@ -1076,11 +1076,9 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->tile_size = TILESIZE; /* standard tile size */ #endif -#if 0 - // CHECK: when setting tile size, should this set width and height? + // when setting tile size, also set width and height accordingly g->width = g->tile_size; g->height = g->tile_size; -#endif } if (g->use_image_size) diff --git a/src/tools.c b/src/tools.c index 5c1f6549..7a15c03e 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)