summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-08 00:16:15 +0200
committerGitHub <noreply@github.com>2022-07-08 00:16:15 +0200
commit5268efdcd9b8e07ed8363f6f32a343392ab4acdf (patch)
tree21019c2d661824314e77df2b0c457c30cc447dc5 /scene/resources
parente3f51d073f29082676fbbeabc80013c892527a48 (diff)
parent78ca147c8a4a3849188b922782de3c16a6aad4b4 (diff)
Merge pull request #62806 from dylan-conway/layered-texture-update-fix-and-error-messages
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/texture.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index f31a71eada..e58ef68388 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -3016,12 +3016,12 @@ Error ImageTextureLayered::create_from_images(Vector<Ref<Image>> p_images) {
}
void ImageTextureLayered::update_layer(const Ref<Image> &p_image, int p_layer) {
- ERR_FAIL_COND(texture.is_valid());
- ERR_FAIL_COND(p_image.is_null());
- ERR_FAIL_COND(p_image->get_format() != format);
- ERR_FAIL_COND(p_image->get_width() != width || p_image->get_height() != height);
- ERR_FAIL_INDEX(p_layer, layers);
- ERR_FAIL_COND(p_image->has_mipmaps() != mipmaps);
+ ERR_FAIL_COND_MSG(texture.is_null(), "Texture is not initialized.");
+ ERR_FAIL_COND_MSG(p_image.is_null(), "Invalid image.");
+ ERR_FAIL_COND_MSG(p_image->get_format() != format, "Image format must match texture's image format.");
+ ERR_FAIL_COND_MSG(p_image->get_width() != width || p_image->get_height() != height, "Image size must match texture's image size.");
+ ERR_FAIL_COND_MSG(p_image->has_mipmaps() != mipmaps, "Image mipmap configuration must match texture's image mipmap configuration.");
+ ERR_FAIL_INDEX_MSG(p_layer, layers, "Layer index is out of bounds.");
RS::get_singleton()->texture_2d_update(texture, p_image, p_layer);
}