mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Compatibility: Fix alignment of compressed textures when retrieving
(cherry picked from commit 0182294b37)
This commit is contained in:
committed by
Rémi Verschelde
parent
6dd8e7fece
commit
4addddd8df
@@ -1039,7 +1039,7 @@ Ref<Image> TextureStorage::texture_2d_get(RID p_texture) const {
|
||||
data.resize(data_size);
|
||||
|
||||
ERR_FAIL_COND_V(data.is_empty(), Ref<Image>());
|
||||
image = Image::create_from_data(texture->width, texture->height, texture->mipmaps > 1, texture->real_format, data);
|
||||
image = Image::create_from_data(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1, texture->real_format, data);
|
||||
ERR_FAIL_COND_V(image->is_empty(), Ref<Image>());
|
||||
if (texture->format != texture->real_format) {
|
||||
image->convert(texture->format);
|
||||
@@ -1095,7 +1095,7 @@ Ref<Image> TextureStorage::texture_2d_get(RID p_texture) const {
|
||||
data.resize(data_size);
|
||||
|
||||
ERR_FAIL_COND_V(data.is_empty(), Ref<Image>());
|
||||
image = Image::create_from_data(texture->width, texture->height, false, Image::FORMAT_RGBA8, data);
|
||||
image = Image::create_from_data(texture->alloc_width, texture->alloc_height, false, Image::FORMAT_RGBA8, data);
|
||||
ERR_FAIL_COND_V(image->is_empty(), Ref<Image>());
|
||||
|
||||
if (texture->format != Image::FORMAT_RGBA8) {
|
||||
|
||||
Reference in New Issue
Block a user