From 31ce3c5fd0300aac1e86bced1efc5f9ec94bdb6b Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 13 Mar 2014 22:57:24 -0300 Subject: -fix bug in cache for atlas import/export -fix some menus -fixed bug in out transition curves -detect and remove file:/// in collada -remove multiscript for now -remove dependencies on mouse in OS, moved to Input -avoid fscache from screwing up (fix might make it slower, but it works) -funcref was missing, it's there now --- core/io/resource_format_binary.cpp | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'core/io/resource_format_binary.cpp') diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index c54398935..47f278596 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -647,7 +647,7 @@ Error ResourceInteractiveLoaderBinary::poll(){ } stage++; - return OK; + return error; } s-=external_resources.size(); @@ -804,7 +804,12 @@ void ResourceInteractiveLoaderBinary::get_dependencies(FileAccess *p_f,Listpush_back(external_resources[i].path); + String dep=external_resources[i].path; + if (dep.ends_with("*")) { + dep=ResourceLoader::guess_full_filename(dep,external_resources[i].type); + } + + p_dependencies->push_back(dep); } } @@ -892,6 +897,19 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { } + //see if the exporter has different set of external resources for more efficient loading + String preload_depts = "deps/"+res_path.md5_text(); + if (Globals::get_singleton()->has(preload_depts)) { + external_resources.clear(); + //ignore external resources and use these + NodePath depts=Globals::get_singleton()->get(preload_depts); + external_resources.resize(depts.get_name_count()); + for(int i=0;iget_32(); @@ -1412,8 +1430,6 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, f->store_32(OBJECT_EXTERNAL_RESOURCE); save_unicode_string(res->get_save_type()); String path=relative_paths?local_path.path_to_file(res->get_path()):res->get_path(); - if (no_extensions) - path=path.basename()+".*"; save_unicode_string(path); } else { @@ -1439,7 +1455,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, f->store_32(VARIANT_DICTIONARY); Dictionary d = p_property; - f->store_32(uint32_t(d.size())|(d.is_shared()?0x80000000:0)); + f->store_32(uint32_t(d.size())|(d.is_shared()?0x80000000:0)); List keys; d.get_key_list(&keys); @@ -1734,7 +1750,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ skip_editor=p_flags&ResourceSaver::FLAG_OMIT_EDITOR_PROPERTIES; bundle_resources=p_flags&ResourceSaver::FLAG_BUNDLE_RESOURCES; big_endian=p_flags&ResourceSaver::FLAG_SAVE_BIG_ENDIAN; - no_extensions=p_flags&ResourceSaver::FLAG_NO_EXTENSION; + local_path=p_path.get_base_dir(); //bin_meta_idx = get_string_index("__bin_meta__"); //is often used, so create @@ -1816,8 +1832,6 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ save_unicode_string(E->get()->get_save_type()); String path = E->get()->get_path(); - if (no_extensions) - path=path.basename()+".*"; save_unicode_string(path); } // save internal resource table @@ -1861,6 +1875,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ } f->seek_end(); + print_line("SAVING: "+p_path); if (p_resource->get_import_metadata().is_valid()) { uint64_t md_pos = f->get_pos(); Ref imd=p_resource->get_import_metadata(); @@ -1869,6 +1884,8 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ for(int i=0;iget_source_count();i++) { save_unicode_string(imd->get_source_path(i)); save_unicode_string(imd->get_source_md5(i)); + print_line("SAVE PATH: "+imd->get_source_path(i)); + print_line("SAVE MD5: "+imd->get_source_md5(i)); } List options; imd->get_options(&options); -- cgit v1.2.3-70-g09d2