summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
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);
}