summaryrefslogtreecommitdiffstats
path: root/scene/resources/texture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/texture.cpp')
-rw-r--r--scene/resources/texture.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 6c7ae2445c..171826cb2f 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -91,7 +91,7 @@ Texture::Texture() {
void ImageTexture::reload_from_file() {
- String path = get_path();
+ String path = ResourceLoader::path_remap(get_path());
if (!path.is_resource_file())
return;
@@ -710,13 +710,16 @@ void StreamTexture::set_flags(uint32_t p_flags) {
void StreamTexture::reload_from_file() {
-#ifdef TOOLS_ENABLED
- String ipath = get_import_path();
- if (ipath.is_resource_file() && ipath != path_to_file) {
- path_to_file = ipath;
- }
-#endif
- load(path_to_file);
+ String path = get_path();
+ if (!path.is_resource_file())
+ return;
+
+ path = ResourceLoader::path_remap(path); //remap for translation
+ path = ResourceLoader::import_remap(path); //remap for import
+ if (!path.is_resource_file())
+ return;
+
+ load(path);
}
void StreamTexture::_bind_methods() {