diff options
author | kobewi <kobewi4e@gmail.com> | 2022-05-22 17:44:19 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-06-07 16:30:54 +0200 |
commit | c519a667ad2ddfbd9ce3e9537406cf108f25d74b (patch) | |
tree | d62a4c4464b614b55b77d02547e17e74b5daa1af /scene | |
parent | e24e4935ffc13715cf7a3dff189ac69d0c7a44e7 (diff) |
Remove image property of ImageTexture
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/texture.cpp | 32 | ||||
-rw-r--r-- | scene/resources/texture.h | 5 |
2 files changed, 0 insertions, 37 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 04b85e3e36..e001aeffc4 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -147,38 +147,6 @@ void ImageTexture::reload_from_file() { } } -bool ImageTexture::_set(const StringName &p_name, const Variant &p_value) { - if (p_name == "image") { - create_from_image(p_value); - } else if (p_name == "size") { - Size2 s = p_value; - w = s.width; - h = s.height; - RenderingServer::get_singleton()->texture_set_size_override(texture, w, h); - } else { - return false; - } - - return true; -} - -bool ImageTexture::_get(const StringName &p_name, Variant &r_ret) const { - if (p_name == "image") { - r_ret = get_image(); - } else if (p_name == "size") { - r_ret = Size2(w, h); - } else { - return false; - } - - return true; -} - -void ImageTexture::_get_property_list(List<PropertyInfo> *p_list) const { - p_list->push_back(PropertyInfo(Variant::OBJECT, PNAME("image"), PROPERTY_HINT_RESOURCE_TYPE, "Image", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT)); - p_list->push_back(PropertyInfo(Variant::VECTOR2, PNAME("size"), PROPERTY_HINT_NONE, "")); -} - void ImageTexture::create_from_image(const Ref<Image> &p_image) { ERR_FAIL_COND_MSG(p_image.is_null() || p_image->is_empty(), "Invalid image"); w = p_image->get_width(); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 317756e313..3e8ac060c4 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -102,11 +102,6 @@ class ImageTexture : public Texture2D { protected: virtual void reload_from_file() override; - - bool _set(const StringName &p_name, const Variant &p_value); - bool _get(const StringName &p_name, Variant &r_ret) const; - void _get_property_list(List<PropertyInfo> *p_list) const; - static void _bind_methods(); public: |