summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-02-06 00:38:39 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-02-06 00:38:39 -0300
commit6f2e16306a6552d704fb2346c9abdd26e0e523b7 (patch)
treee1fadf2a05d6f04675045b9e34128ed96628e07c /core/io
parentaf3fabeb7745e6f7f4e7fe7a299bdd234fff26a6 (diff)
Several bugfixes, improving the import workflow
Diffstat (limited to 'core/io')
-rw-r--r--core/io/resource_import.cpp23
-rw-r--r--core/io/resource_import.h1
2 files changed, 23 insertions, 1 deletions
diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp
index d0799cdbe6..0ca912c9f7 100644
--- a/core/io/resource_import.cpp
+++ b/core/io/resource_import.cpp
@@ -1,5 +1,6 @@
#include "resource_import.h"
#include "variant_parser.h"
+#include "os/os.h"
Error ResourceFormatImporter::_get_path_and_type(const String& p_path, PathAndType &r_path_and_type) const {
@@ -36,7 +37,13 @@ Error ResourceFormatImporter::_get_path_and_type(const String& p_path, PathAndTy
}
if (assign!=String()) {
- if (assign=="path") {
+ if (assign.begins_with("path.") && r_path_and_type.path==String()) {
+ String feature = assign.get_slicec('.',1);
+ if (OS::get_singleton()->check_feature_support(feature)) {
+ r_path_and_type.path=value;
+ }
+
+ } else if (assign=="path") {
r_path_and_type.path=value;
} else if (assign=="type") {
r_path_and_type.type=value;
@@ -154,6 +161,20 @@ bool ResourceFormatImporter::handles_type(const String& p_type) const {
return true;
}
+
+String ResourceFormatImporter::get_internal_resource_path(const String& p_path) const {
+
+ PathAndType pat;
+ Error err = _get_path_and_type(p_path,pat);
+
+ if (err!=OK) {
+
+ return String();
+ }
+
+ return pat.path;
+}
+
String ResourceFormatImporter::get_resource_type(const String &p_path) const {
PathAndType pat;
diff --git a/core/io/resource_import.h b/core/io/resource_import.h
index 939cecfbd9..387b3902fe 100644
--- a/core/io/resource_import.h
+++ b/core/io/resource_import.h
@@ -31,6 +31,7 @@ public:
virtual bool can_be_imported(const String& p_path) const;
+ String get_internal_resource_path(const String& p_path) const;
void add_importer(const Ref<ResourceImporter>& p_importer) { importers.insert(p_importer); }
Ref<ResourceImporter> get_importer_by_name(const String& p_name);