From 6e56c461fefce56a5f7a07359d485f85294631dd Mon Sep 17 00:00:00 2001 From: Jakob Ilves Date: Fri, 17 May 2024 06:05:17 +0200 Subject: [PATCH] Always make create_plr_sprite call to create_sprite use full tile size If scale is unchanged, that is 1.0f, create_plr_sprite is called with the hardcoded 128 width and 64 height and the actual full width and height of the tile are completely ignored. This causes problems for tilesets which have large sized hiresolution tiles as one gets border graphics and solid background cut off after the top 64 pixels high portion of the tile. If scale is not 1.0f, the routine create_plr_sprite does the right thing and considers the values of full_tile_width and full_tile_height. My fix in this commit is to simply skip testing the value of scale and always use the values for full_tile_width and full_tile_height. The code that hardcodes tile width to 128 and height to 64 is simply removed. --- client/tilespec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/tilespec.c b/client/tilespec.c index f2ab74fcf3..a49b2603d6 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -2802,12 +2802,8 @@ static struct sprite *create_plr_sprite(struct color *pcolor) fc_assert_ret_val(pcolor != NULL, NULL); - if (tileset->scale == 1.0f) { - sprite = create_sprite(128, 64, pcolor); - } else { - sprite = create_sprite(tileset->full_tile_width, - tileset->full_tile_height, pcolor); - } + sprite = create_sprite(tileset->full_tile_width, + tileset->full_tile_height, pcolor); return sprite; } -- 2.34.1