summaryrefslogtreecommitdiff
path: root/core
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 /core
parentb4f579b5ba8df8b8972c79a10b6d9c8b0719829f (diff)
-Deprecate ImageTexture::load
-Add warning to Image::load when loading resources -Add script binding for get_configuration_warning
Diffstat (limited to 'core')
-rw-r--r--core/image.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/image.cpp b/core/image.cpp
index 65905c83e8..c94f2c3534 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -36,8 +36,8 @@
#include "math_funcs.h"
#include "print_string.h"
+#include "io/resource_loader.h"
#include "thirdparty/misc/hq2x.h"
-
#include <stdio.h>
const char *Image::format_names[Image::FORMAT_MAX] = {
@@ -1582,7 +1582,11 @@ Image::AlphaMode Image::detect_alpha() const {
}
Error Image::load(const String &p_path) {
-
+#ifdef DEBUG_ENABLED
+ if (p_path.begins_with("res://") && ResourceLoader::exists(p_path)) {
+ WARN_PRINTS("Loaded resource as image file, this will not work on export: '" + p_path + "'. Instead, import the image file as an Image resource and load it normally as a resource.");
+ }
+#endif
return ImageLoader::load_image(p_path, this);
}