From ff60f7b6d497bceb39935efa2dc753181025f80e Mon Sep 17 00:00:00 2001 From: aaronp64 Date: Sun, 21 Apr 2024 21:36:12 -0400 Subject: [PATCH] Handle compressed images in TileSetAtlasSource::_create_padded_image_texture Check for compressed image and decompress if needed Fixes #78755 --- scene/resources/2d/tile_set.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/resources/2d/tile_set.cpp b/scene/resources/2d/tile_set.cpp index 04b00b6bdbce..57cc4ad602ee 100644 --- a/scene/resources/2d/tile_set.cpp +++ b/scene/resources/2d/tile_set.cpp @@ -5591,6 +5591,11 @@ Ref TileSetAtlasSource::_create_padded_image_texture(const Refis_compressed()) { + src_image = src_image->duplicate(); + Error err = src_image->decompress(); + ERR_FAIL_COND_V_MSG(err != OK, Ref(), "Unable to decompress image."); + } Size2 size = get_atlas_grid_size() * (texture_region_size + Vector2i(2, 2)); Ref image = Image::create_empty(size.x, size.y, false, src_image->get_format());