aboutsummaryrefslogtreecommitdiff
path: root/core/io/resource_loader.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2017-02-12 22:52:02 -0300
committerJuan Linietsky2017-02-12 23:13:14 -0300
commitebb7d2cdb7c5cd755f0b4b69db934df9cc15b1d6 (patch)
tree54834d4b17f9ec1c164ea213e5343104d37308b6 /core/io/resource_loader.cpp
parent6abe141579742a0a84234bc71257d7b037511f36 (diff)
downloadgodot-ebb7d2cdb7c5cd755f0b4b69db934df9cc15b1d6.tar.gz
godot-ebb7d2cdb7c5cd755f0b4b69db934df9cc15b1d6.tar.zst
godot-ebb7d2cdb7c5cd755f0b4b69db934df9cc15b1d6.zip
-WIP Exporter to Godot 3.0, only text scenes (no .scn) and still kind of buggy
Diffstat (limited to 'core/io/resource_loader.cpp')
-rw-r--r--core/io/resource_loader.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 87e5d72a1..2fa3a996c 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -399,6 +399,34 @@ void ResourceLoader::get_dependencies(const String& p_path, List<String> *p_depe
}
}
+Error ResourceLoader::get_export_data(const String& p_path,ExportData& r_export_data) {
+
+
+ String local_path;
+ if (p_path.is_rel_path())
+ local_path="res://"+p_path;
+ else
+ local_path = Globals::get_singleton()->localize_path(p_path);
+
+ String remapped_path = PathRemap::get_singleton()->get_remap(local_path);
+
+ String extension=remapped_path.extension();
+
+ for (int i=0;i<loader_count;i++) {
+
+ if (!loader[i]->recognize(extension))
+ continue;
+ //if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint))
+ // continue;
+
+ return loader[i]->get_export_data(p_path,r_export_data);
+
+ }
+
+ return ERR_UNAVAILABLE;
+
+}
+
Error ResourceLoader::rename_dependencies(const String &p_path,const Map<String,String>& p_map) {