summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-08-14 16:52:40 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-08-14 16:53:20 -0300
commitef5095720b56e72d99b8ca2773e2a5fa24f7097d (patch)
tree0bce6823074c09087a8da611c2215f0c1d08bb89 /scene/resources
parentb4f579b5ba8df8b8972c79a10b6d9c8b0719829f (diff)
-Deprecate ImageTexture::load
-Add warning to Image::load when loading resources -Add script binding for get_configuration_warning
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/texture.cpp7
-rw-r--r--scene/resources/texture.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 536c653a0c..2f663431de 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -214,9 +214,10 @@ Image::Format ImageTexture::get_format() const {
return format;
}
-
+#ifndef DISABLE_DEPRECATED
Error ImageTexture::load(const String &p_path) {
+ WARN_DEPRECATED
Ref<Image> img;
img.instance();
Error err = img->load(p_path);
@@ -225,7 +226,7 @@ Error ImageTexture::load(const String &p_path) {
}
return err;
}
-
+#endif
void ImageTexture::set_data(const Ref<Image> &p_image) {
ERR_FAIL_COND(p_image.is_null());
@@ -345,7 +346,9 @@ void ImageTexture::_bind_methods() {
ClassDB::bind_method(D_METHOD("create", "width", "height", "format", "flags"), &ImageTexture::create, DEFVAL(FLAGS_DEFAULT));
ClassDB::bind_method(D_METHOD("create_from_image", "image", "flags"), &ImageTexture::create_from_image, DEFVAL(FLAGS_DEFAULT));
ClassDB::bind_method(D_METHOD("get_format"), &ImageTexture::get_format);
+#ifndef DISABLE_DEPRECATED
ClassDB::bind_method(D_METHOD("load", "path"), &ImageTexture::load);
+#endif
ClassDB::bind_method(D_METHOD("set_data", "image"), &ImageTexture::set_data);
ClassDB::bind_method(D_METHOD("set_storage", "mode"), &ImageTexture::set_storage);
ClassDB::bind_method(D_METHOD("get_storage"), &ImageTexture::get_storage);
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 1c18189b2c..c15efb6eaa 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -125,7 +125,9 @@ public:
void set_flags(uint32_t p_flags);
uint32_t get_flags() const;
Image::Format get_format() const;
+#ifndef DISABLE_DEPRECATED
Error load(const String &p_path);
+#endif
void set_data(const Ref<Image> &p_image);
Ref<Image> get_data() const;