-Deprecate ImageTexture::load
-Add warning to Image::load when loading resources -Add script binding for get_configuration_warning
This commit is contained in:
parent
b4f579b5ba
commit
ef5095720b
4 changed files with 17 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue