aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--core/io/export_data.cpp2
-rw-r--r--core/io/export_data.h86
-rw-r--r--core/io/resource_format_binary.cpp177
-rw-r--r--core/io/resource_format_binary.h7
-rw-r--r--core/io/resource_format_xml.cpp184
-rw-r--r--core/io/resource_format_xml.h6
-rw-r--r--core/io/resource_loader.cpp28
-rw-r--r--core/io/resource_loader.h5
-rw-r--r--core/os/dir_access.cpp2
-rw-r--r--core/variant_parser.cpp13
-rw-r--r--core/variant_parser.h2
11 files changed, 459 insertions, 53 deletions
diff --git a/core/io/export_data.cpp b/core/io/export_data.cpp
new file mode 100644
index 000000000..2495288a7
--- /dev/null
+++ b/core/io/export_data.cpp
@@ -0,0 +1,2 @@
+#include "export_data.h"
+
diff --git a/core/io/export_data.h b/core/io/export_data.h
new file mode 100644
index 000000000..17ee60f33
--- /dev/null
+++ b/core/io/export_data.h
@@ -0,0 +1,86 @@
+#ifndef EXPORT_DATA_H
+#define EXPORT_DATA_H
+
+#include "variant.h"
+#include "vector.h"
+#include "map.h"
+struct ExportData {
+
+ struct Dependency {
+ String path;
+ String type;
+ };
+
+ Map<int,Dependency> dependencies;
+
+ struct PropertyData {
+ String name;
+ Variant value;
+ };
+
+ struct ResourceData {
+
+ String type;
+ int index;
+ List<PropertyData> properties;
+
+ };
+
+ Vector<ResourceData> resources;
+
+
+ struct NodeData {
+
+ bool text_data;
+ String name;
+ String type;
+ String instance;
+ //int info
+ int owner_int; //depending type
+ int parent_int;
+ bool instance_is_placeholder;
+
+
+ //text info
+ NodePath parent;
+ NodePath owner;
+ String instance_placeholder;
+
+
+
+ Vector<String> groups;
+ List<PropertyData> properties;
+
+
+ NodeData() { parent_int=0; owner_int=0; text_data=true; }
+ };
+
+ Vector<NodeData> nodes;
+
+ struct Connection {
+
+ bool text_data;
+
+ int from_int;
+ int to_int;
+
+ NodePath from;
+ NodePath to;
+ String signal;
+ String method;
+ Array binds;
+ int flags;
+
+ Connection() { text_data=true; }
+ };
+
+ Vector<Connection> connections;
+ Vector<NodePath> editables;
+
+ Array node_paths; //for integer packed data
+ Variant base_scene;
+
+
+};
+
+#endif // EXPORT_DATA_H
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index a49b1f79c..2b6cfe051 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -118,7 +118,7 @@ void ResourceInteractiveLoaderBinary::_advance_padding(uint32_t p_len) {
}
-Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) {
+Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v,bool p_for_export_data) {
uint32_t type = f->get_32();
@@ -378,62 +378,79 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) {
} break;
case OBJECT_INTERNAL_RESOURCE: {
uint32_t index=f->get_32();
- String path = res_path+"::"+itos(index);
- RES res = ResourceLoader::load(path);
- if (res.is_null()) {
- WARN_PRINT(String("Couldn't load resource: "+path).utf8().get_data());
+
+ if (p_for_export_data) {
+
+ r_v="@RESLOCAL:"+itos(index);
+ } else {
+ String path = res_path+"::"+itos(index);
+ RES res = ResourceLoader::load(path);
+ if (res.is_null()) {
+ WARN_PRINT(String("Couldn't load resource: "+path).utf8().get_data());
+ }
+ r_v=res;
}
- r_v=res;
} break;
case OBJECT_EXTERNAL_RESOURCE: {
//old file format, still around for compatibility
+
String type = get_unicode_string();
String path = get_unicode_string();
- if (path.find("://")==-1 && path.is_rel_path()) {
- // path is relative to file being loaded, so convert to a resource path
- path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
+ if (p_for_export_data) {
- }
+ r_v="@RESPATH:"+type+":"+path;
+ } else {
- if (remaps.find(path)) {
- path=remaps[path];
- }
+ if (path.find("://")==-1 && path.is_rel_path()) {
+ // path is relative to file being loaded, so convert to a resource path
+ path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
- RES res=ResourceLoader::load(path,type);
+ }
+
+ if (remaps.find(path)) {
+ path=remaps[path];
+ }
- if (res.is_null()) {
- WARN_PRINT(String("Couldn't load resource: "+path).utf8().get_data());
+ RES res=ResourceLoader::load(path,type);
+
+ if (res.is_null()) {
+ WARN_PRINT(String("Couldn't load resource: "+path).utf8().get_data());
+ }
+ r_v=res;
}
- r_v=res;
} break;
case OBJECT_EXTERNAL_RESOURCE_INDEX: {
//new file format, just refers to an index in the external list
uint32_t erindex = f->get_32();
- if (erindex>=external_resources.size()) {
- WARN_PRINT("Broken external resource! (index out of size");
- r_v=Variant();
+ if (p_for_export_data) {
+ r_v="@RESEXTERNAL:"+itos(erindex);
} else {
+ if (erindex>=external_resources.size()) {
+ WARN_PRINT("Broken external resource! (index out of size");
+ r_v=Variant();
+ } else {
- String type = external_resources[erindex].type;
- String path = external_resources[erindex].path;
+ String type = external_resources[erindex].type;
+ String path = external_resources[erindex].path;
- if (path.find("://")==-1 && path.is_rel_path()) {
- // path is relative to file being loaded, so convert to a resource path
- path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
+ if (path.find("://")==-1 && path.is_rel_path()) {
+ // path is relative to file being loaded, so convert to a resource path
+ path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
- }
+ }
- RES res=ResourceLoader::load(path,type);
+ RES res=ResourceLoader::load(path,type);
- if (res.is_null()) {
- WARN_PRINT(String("Couldn't load resource: "+path).utf8().get_data());
+ if (res.is_null()) {
+ WARN_PRINT(String("Couldn't load resource: "+path).utf8().get_data());
+ }
+ r_v=res;
}
- r_v=res;
}
@@ -455,10 +472,10 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) {
len&=0x7FFFFFFF;
for(uint32_t i=0;i<len;i++) {
Variant key;
- Error err = parse_variant(key);
+ Error err = parse_variant(key,p_for_export_data);
ERR_FAIL_COND_V(err,ERR_FILE_CORRUPT);
Variant value;
- err = parse_variant(value);
+ err = parse_variant(value,p_for_export_data);
ERR_FAIL_COND_V(err,ERR_FILE_CORRUPT);
d[key]=value;
}
@@ -472,7 +489,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) {
a.resize(len);
for(uint32_t i=0;i<len;i++) {
Variant val;
- Error err = parse_variant(val);
+ Error err = parse_variant(val,p_for_export_data);
ERR_FAIL_COND_V(err,ERR_FILE_CORRUPT);
a[i]=val;
}
@@ -862,6 +879,77 @@ String ResourceInteractiveLoaderBinary::get_unicode_string() {
return s;
}
+Error ResourceInteractiveLoaderBinary::get_export_data(ExportData& r_export_data) {
+
+ for(int i=0;i<external_resources.size();i++) {
+ ExportData::Dependency dep;
+ dep.path=external_resources[i].path;
+ dep.type=external_resources[i].type;
+ r_export_data.dependencies[i]=dep;
+ }
+
+ for(int i=0;i<internal_resources.size();i++) {
+
+ bool main = i==(internal_resources.size()-1);
+
+ //maybe it is loaded already
+
+
+ r_export_data.resources.resize( r_export_data.resources.size()+1 );
+ ExportData::ResourceData &res_data=r_export_data.resources[ r_export_data.resources.size()-1 ];
+
+ res_data.index=-1;
+
+ if (!main) {
+
+ String path=internal_resources[i].path;
+ if (path.begins_with("local://")) {
+ path=path.replace_first("local://","");
+ res_data.index = path.to_int();
+ }
+ } else {
+
+ }
+
+ uint64_t offset = internal_resources[i].offset;
+
+ f->seek(offset);
+
+ String t = get_unicode_string();
+
+ res_data.type=t;
+
+ int pc = f->get_32();
+
+ //set properties
+
+ for(int i=0;i<pc;i++) {
+
+ uint32_t name_idx = f->get_32();
+ if (name_idx>=(uint32_t)string_map.size()) {
+ error=ERR_FILE_CORRUPT;
+ ERR_FAIL_V(ERR_FILE_CORRUPT);
+ }
+
+ Variant value;
+
+ error = parse_variant(value,true);
+ if (error)
+ return error;
+
+ ExportData::PropertyData pdata;
+ pdata.name=string_map[name_idx];
+ pdata.value=value;
+
+ res_data.properties.push_back(pdata);
+ }
+
+ }
+
+ return OK;
+}
+
+
void ResourceInteractiveLoaderBinary::get_dependencies(FileAccess *p_f,List<String> *p_dependencies,bool p_add_types) {
@@ -1175,6 +1263,7 @@ Error ResourceFormatLoaderBinary::load_import_metadata(const String &p_path, Ref
}
+ResourceFormatLoaderBinary *ResourceFormatLoaderBinary::singleton=NULL;
void ResourceFormatLoaderBinary::get_dependencies(const String& p_path,List<String> *p_dependencies,bool p_add_types) {
@@ -1188,6 +1277,28 @@ void ResourceFormatLoaderBinary::get_dependencies(const String& p_path,List<Stri
ria->get_dependencies(f,p_dependencies,p_add_types);
}
+
+Error ResourceFormatLoaderBinary::get_export_data(const String& p_path,ExportData& r_export_data) {
+
+ Error err;
+ FileAccess *f = FileAccess::open(p_path,FileAccess::READ,&err);
+
+ if (err!=OK) {
+
+ ERR_FAIL_COND_V(err!=OK,ERR_CANT_OPEN);
+ }
+
+ Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary );
+ ria->local_path=Globals::get_singleton()->localize_path(p_path);
+ ria->res_path=ria->local_path;
+// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
+ ria->open(f);
+
+
+ return ria->get_export_data(r_export_data);
+
+}
+
Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path,const Map<String,String>& p_map) {
diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h
index 611029e79..566767b83 100644
--- a/core/io/resource_format_binary.h
+++ b/core/io/resource_format_binary.h
@@ -79,7 +79,7 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader {
friend class ResourceFormatLoaderBinary;
- Error parse_variant(Variant& r_v);
+ Error parse_variant(Variant& r_v, bool p_for_export_data=false);
public:
@@ -94,6 +94,7 @@ public:
String recognize(FileAccess *p_f);
void get_dependencies(FileAccess *p_f, List<String> *p_dependencies, bool p_add_types);
+ Error get_export_data(ExportData& r_export_data);
ResourceInteractiveLoaderBinary();
~ResourceInteractiveLoaderBinary();
@@ -111,9 +112,11 @@ public:
virtual void get_dependencies(const String& p_path, List<String> *p_dependencies, bool p_add_types=false);
virtual Error load_import_metadata(const String &p_path, Ref<ResourceImportMetadata>& r_var) const;
virtual Error rename_dependencies(const String &p_path,const Map<String,String>& p_map);
+ virtual Error get_export_data(const String& p_path,ExportData& r_export_data);
+ static ResourceFormatLoaderBinary *singleton;
-
+ ResourceFormatLoaderBinary() { singleton=this; }
};
diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp
index cc0a3b488..8be6a32f6 100644
--- a/core/io/resource_format_xml.cpp
+++ b/core/io/resource_format_xml.cpp
@@ -339,7 +339,7 @@ Error ResourceInteractiveLoaderXML::_parse_array_element(Vector<char> &buff,bool
return OK;
}
-Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name) {
+Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name, bool p_for_export_data) {
bool exit;
Tag *tag = parse_tag(&exit);
@@ -382,7 +382,7 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name)
int dictline = get_current_line();
- err=parse_property(key,tagname);
+ err=parse_property(key,tagname,p_for_export_data);
if (err && err!=ERR_FILE_EOF) {
ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error parsing dictionary: "+name+" (from line "+itos(dictline)+")");
@@ -392,7 +392,7 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name)
if (err)
break;
Variant value;
- err=parse_property(value,tagname);
+ err=parse_property(value,tagname,p_for_export_data);
if (err) {
ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error parsing dictionary: "+name+" (from line "+itos(dictline)+")");
}
@@ -429,7 +429,7 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name)
Variant v;
String tagname;
int idx=0;
- while( (err=parse_property(v,tagname))==OK ) {
+ while( (err=parse_property(v,tagname,p_for_export_data))==OK ) {
ERR_CONTINUE( idx <0 || idx >=len );
@@ -463,7 +463,20 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name)
if (tag->args.has("resource_type"))
hint=tag->args["resource_type"];
+ if (p_for_export_data) {
+
+ String prop;
+
+ if (path.begins_with("local://")) {
+ prop="@RESLOCAL:"+itos(path.replace("local://","").to_int());
+ }
+
+ r_v=prop;
+ return OK;
+ }
+
if (path.begins_with("local://"))
+
path=path.replace("local://",local_path+"::");
else if (path.find("://")==-1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
@@ -488,6 +501,18 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name)
} else if (tag->args.has("external")) {
int index = tag->args["external"].to_int();
+
+
+ if (p_for_export_data) {
+
+ String prop;
+
+ prop="@RESEXTERNAL:"+itos(index);
+
+ r_v=prop;
+ return OK;
+ }
+
if (ext_resources.has(index)) {
String path=ext_resources[index].path;
String type=ext_resources[index].type;
@@ -1653,6 +1678,139 @@ void ResourceInteractiveLoaderXML::get_dependencies(FileAccess *f,List<String> *
}
+Error ResourceInteractiveLoaderXML::get_export_data(FileAccess *p_f,ExportData& r_export_data) {
+
+ open(p_f);
+ ERR_FAIL_COND_V(error!=OK,error);
+
+
+
+ while (true) {
+ bool exit;
+ Tag *tag = parse_tag(&exit);
+
+ if (!tag) {
+ error=ERR_FILE_CORRUPT;
+ if (!exit) // shouldn't have exited
+ ERR_FAIL_V(error);
+ error=ERR_FILE_EOF;
+ return error;
+ }
+
+
+ bool main;
+
+ if (tag->name=="ext_resource") {
+
+ ExportData::Dependency dep;
+
+ error=ERR_FILE_CORRUPT;
+ ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": <ext_resource> missing 'path' field.");
+ ERR_FAIL_COND_V(!tag->args.has("path"),ERR_FILE_CORRUPT);
+
+ String type="Resource";
+ if (tag->args.has("type"))
+ type=tag->args["type"];
+
+ String path = tag->args["path"];
+
+ dep.path=path;
+ dep.type=type;
+
+
+ if (tag->args.has("index")) {
+ ExtResource er;
+ er.path=path;
+ er.type=type;
+ r_export_data.dependencies[tag->args["index"].to_int()]=dep;
+ } else {
+
+ int index = r_export_data.dependencies.size();
+ r_export_data.dependencies[index]=dep;
+
+ }
+
+
+
+ Error err = close_tag("ext_resource");
+ if (err)
+ return error;
+
+ continue;
+
+ } else if (tag->name=="resource") {
+
+ main=false;
+ } else if (tag->name=="main_resource") {
+ main=true;
+ } else {
+ ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": unexpected main tag: "+tag->name);
+ error=ERR_FILE_CORRUPT;
+ ERR_FAIL_V(error);
+ }
+
+ r_export_data.resources.resize( r_export_data.resources.size()+1 );
+
+ ExportData::ResourceData &res_data=r_export_data.resources[ r_export_data.resources.size()-1 ];
+
+
+ res_data.index=-1;
+
+ if (!main) {
+ //loading resource
+
+
+ String path=tag->args["path"];
+
+ error=OK;
+
+ if (path.begins_with("local://")) {
+ //built-in resource (but really external)
+
+ path=path.replace("local://","");
+ res_data.index=path.to_int();
+ }
+
+ res_data.type= tag->args["type"];
+ } else {
+ res_data.type=resource_type;
+
+
+ }
+ //load properties
+
+ while(true) {
+
+ String name;
+ Variant v;
+ Error err;
+
+ err = parse_property(v,name);
+
+ if (err==ERR_FILE_EOF) //tag closed
+ break;
+
+
+ if (err!=OK) {
+ ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": XML Parsing aborted.");
+ ERR_FAIL_COND_V(err!=OK,ERR_FILE_CORRUPT);
+ }
+
+ ExportData::PropertyData prop;
+ prop.name=name;
+ prop.value=v;
+ res_data.properties.push_back(prop);
+
+ }
+ if (main) {
+ return OK;
+
+ }
+ }
+ return OK;
+}
+
+
Error ResourceInteractiveLoaderXML::rename_dependencies(FileAccess *p_f, const String &p_path,const Map<String,String>& p_map) {
open(p_f);
@@ -2021,6 +2179,23 @@ void ResourceFormatLoaderXML::get_dependencies(const String& p_path,List<String>
}
+Error ResourceFormatLoaderXML::get_export_data(const String& p_path,ExportData& r_export_data) {
+
+ FileAccess *f = FileAccess::open(p_path,FileAccess::READ);
+ if (!f) {
+
+ ERR_FAIL_V(ERR_CANT_OPEN);
+ }
+
+ Ref<ResourceInteractiveLoaderXML> ria = memnew( ResourceInteractiveLoaderXML );
+ ria->local_path=Globals::get_singleton()->localize_path(p_path);
+ ria->res_path=ria->local_path;
+
+ return ria->get_export_data(f,r_export_data);
+
+}
+
+
Error ResourceFormatLoaderXML::rename_dependencies(const String &p_path,const Map<String,String>& p_map) {
FileAccess *f = FileAccess::open(p_path,FileAccess::READ);
@@ -2036,6 +2211,7 @@ Error ResourceFormatLoaderXML::rename_dependencies(const String &p_path,const Ma
return ria->rename_dependencies(f,p_path,p_map);
}
+ResourceFormatLoaderXML *ResourceFormatLoaderXML::singleton=NULL;
/****************************************************************************************/
/****************************************************************************************/
diff --git a/core/io/resource_format_xml.h b/core/io/resource_format_xml.h
index 097c2e43f..5923817b6 100644
--- a/core/io/resource_format_xml.h
+++ b/core/io/resource_format_xml.h
@@ -79,7 +79,7 @@ friend class ResourceFormatLoaderXML;
_FORCE_INLINE_ void unquote(String& p_str);
Error goto_end_of_tag();
Error parse_property_data(String &r_data);
- Error parse_property(Variant& r_v, String &r_name);
+ Error parse_property(Variant& r_v, String &r_name,bool p_for_export_data=false);
Error error;
@@ -98,6 +98,7 @@ public:
void get_dependencies(FileAccess *p_f, List<String> *p_dependencies, bool p_add_types);
Error rename_dependencies(FileAccess *p_f, const String &p_path,const Map<String,String>& p_map);
+ Error get_export_data(FileAccess *p_f,ExportData& r_export_data);
~ResourceInteractiveLoaderXML();
@@ -106,6 +107,7 @@ public:
class ResourceFormatLoaderXML : public ResourceFormatLoader {
public:
+ static ResourceFormatLoaderXML *singleton;
virtual Ref<ResourceInteractiveLoader> load_interactive(const String &p_path,Error *r_error=NULL);
virtual void get_recognized_extensions_for_type(const String& p_type,List<String> *p_extensions) const;
virtual void get_recognized_extensions(List<String> *p_extensions) const;
@@ -113,7 +115,9 @@ public:
virtual String get_resource_type(const String &p_path) const;
virtual void get_dependencies(const String& p_path, List<String> *p_dependencies, bool p_add_types=false);
virtual Error rename_dependencies(const String &p_path,const Map<String,String>& p_map);
+ virtual Error get_export_data(const String& p_path,ExportData& r_export_data);
+ ResourceFormatLoaderXML() { singleton=this; }
};
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) {
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h
index de54dbde6..14a7ee83d 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -30,7 +30,7 @@
#define RESOURCE_LOADER_H
#include "resource.h"
-
+#include "export_data.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
@@ -67,6 +67,7 @@ public:
virtual void get_dependencies(const String& p_path,List<String> *p_dependencies,bool p_add_types=false);
virtual Error load_import_metadata(const String &p_path, Ref<ResourceImportMetadata>& r_var) const { return ERR_UNAVAILABLE; }
virtual Error rename_dependencies(const String &p_path,const Map<String,String>& p_map) { return OK; }
+ virtual Error get_export_data(const String& p_path,ExportData& r_export_data) { return ERR_UNAVAILABLE; }
virtual ~ResourceFormatLoader() {}
};
@@ -107,6 +108,8 @@ public:
static void get_dependencies(const String& p_path,List<String> *p_dependencies,bool p_add_types=false);
static Error rename_dependencies(const String &p_path,const Map<String,String>& p_map);
+ static Error get_export_data(const String& p_path,ExportData& r_export_data);
+
static String guess_full_filename(const String &p_path,const String& p_type);
static void set_timestamp_on_load(bool p_timestamp) { timestamp_on_load=p_timestamp; }
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index 7b60baeeb..e3ec98dd6 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -178,9 +178,9 @@ Error DirAccess::make_dir_recursive(String p_dir) {
for(int i=0;i<subdirs.size();i++) {
curpath=curpath.plus_file(subdirs[i]);
+
Error err = make_dir(curpath);
if (err != OK && err != ERR_ALREADY_EXISTS) {
-
ERR_FAIL_V(err);
}
}
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index 6b7532ebf..910e809ff 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -907,32 +907,25 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
if (p_res_parser && id=="Resource" && p_res_parser->func){
- RES res;
- Error err = p_res_parser->func(p_res_parser->userdata,p_stream,res,line,r_err_str);
+ Error err = p_res_parser->func(p_res_parser->userdata,p_stream,value,line,r_err_str);
if (err)
return err;
- value=res;
-
return OK;
} else if (p_res_parser && id=="ExtResource" && p_res_parser->ext_func){
- RES res;
- Error err = p_res_parser->ext_func(p_res_parser->userdata,p_stream,res,line,r_err_str);
+ Error err = p_res_parser->ext_func(p_res_parser->userdata,p_stream,value,line,r_err_str);
if (err)
return err;
- value=res;
return OK;
} else if (p_res_parser && id=="SubResource" && p_res_parser->sub_func){
- RES res;
- Error err = p_res_parser->sub_func(p_res_parser->userdata,p_stream,res,line,r_err_str);
+ Error err = p_res_parser->sub_func(p_res_parser->userdata,p_stream,value,line,r_err_str);
if (err)
return err;
- value=res;
return OK;
} else {
diff --git a/core/variant_parser.h b/core/variant_parser.h
index c69673b0e..d1fdb37d9 100644
--- a/core/variant_parser.h
+++ b/core/variant_parser.h
@@ -73,7 +73,7 @@ public:
};
- typedef Error (*ParseResourceFunc)(void* p_self, Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str);
+ typedef Error (*ParseResourceFunc)(void* p_self, Stream* p_stream,Variant& r_res,int &line,String &r_err_str);
struct ResourceParser {