diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-01 15:17:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-01 15:17:33 +0200 |
commit | ad8a2b3d527f821d1a0b061811661d49d0920967 (patch) | |
tree | 500453dd29cce8ceb39007ac5a5902f0504c1332 /scene/resources | |
parent | 9f30638d4bbc5a30c6f4f5cff99910bf8e19c2e3 (diff) | |
parent | 37776b28677ab4c4cb61047df1fe9816e9b63642 (diff) |
Merge pull request #50040 from reduz/fix-renderingserver-bindings
Clean up RenderingServer and its bindings
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/texture.cpp | 10 | ||||
-rw-r--r-- | scene/resources/texture.h | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index acc85cf7df..72031c3a69 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -173,7 +173,7 @@ Image::Format ImageTexture::get_format() const { return format; } -void ImageTexture::update(const Ref<Image> &p_image, bool p_immediate) { +void ImageTexture::update(const Ref<Image> &p_image) { ERR_FAIL_COND_MSG(p_image.is_null(), "Invalid image"); ERR_FAIL_COND_MSG(texture.is_null(), "Texture is not initialized."); ERR_FAIL_COND_MSG(p_image->get_width() != w || p_image->get_height() != h, @@ -183,11 +183,7 @@ void ImageTexture::update(const Ref<Image> &p_image, bool p_immediate) { ERR_FAIL_COND_MSG(mipmaps != p_image->has_mipmaps(), "The new image mipmaps configuration must match the texture's image mipmaps configuration"); - if (p_immediate) { - RenderingServer::get_singleton()->texture_2d_update_immediate(texture, p_image); - } else { - RenderingServer::get_singleton()->texture_2d_update(texture, p_image); - } + RenderingServer::get_singleton()->texture_2d_update(texture, p_image); notify_property_list_changed(); emit_changed(); @@ -305,7 +301,7 @@ void ImageTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("create_from_image", "image"), &ImageTexture::create_from_image); ClassDB::bind_method(D_METHOD("get_format"), &ImageTexture::get_format); - ClassDB::bind_method(D_METHOD("update", "image", "immediate"), &ImageTexture::update, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("update", "image"), &ImageTexture::update); ClassDB::bind_method(D_METHOD("set_size_override", "size"), &ImageTexture::set_size_override); ClassDB::bind_method(D_METHOD("_reload_hook", "rid"), &ImageTexture::_reload_hook); } diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 3b1815266d..40193e3ff6 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -107,7 +107,7 @@ public: Image::Format get_format() const; - void update(const Ref<Image> &p_image, bool p_immediate = false); + void update(const Ref<Image> &p_image); Ref<Image> get_image() const override; int get_width() const override; |