Merge pull request #90994 from aaronp64/tileset_compressed_image
Handle compressed images in `TileSetAtlasSource::_create_padded_image_texture`
This commit is contained in:
commit
7529c0bec5
|
@ -5591,6 +5591,11 @@ Ref<ImageTexture> TileSetAtlasSource::_create_padded_image_texture(const Ref<Tex
|
||||||
ret.instantiate();
|
ret.instantiate();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (src_image->is_compressed()) {
|
||||||
|
src_image = src_image->duplicate();
|
||||||
|
Error err = src_image->decompress();
|
||||||
|
ERR_FAIL_COND_V_MSG(err != OK, Ref<ImageTexture>(), "Unable to decompress image.");
|
||||||
|
}
|
||||||
|
|
||||||
Size2 size = get_atlas_grid_size() * (texture_region_size + Vector2i(2, 2));
|
Size2 size = get_atlas_grid_size() * (texture_region_size + Vector2i(2, 2));
|
||||||
Ref<Image> image = Image::create_empty(size.x, size.y, false, src_image->get_format());
|
Ref<Image> image = Image::create_empty(size.x, size.y, false, src_image->get_format());
|
||||||
|
|
Loading…
Reference in New Issue