MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / load_import_metadata

Method load_import_metadata

compat/resource_compat_binary.cpp:3000–3031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2998}
2999
3000Error ResourceLoaderCompatBinary::load_import_metadata(bool p_return_to_pos) {
3001 if (f.is_null()) {
3002 return ERR_CANT_ACQUIRE_RESOURCE;
3003 }
3004 if (importmd_ofs == 0) {
3005 return ERR_UNAVAILABLE;
3006 }
3007 if (imd.is_null()) {
3008 imd.instantiate();
3009 }
3010 uint64_t pos = f->get_position();
3011 f->seek(importmd_ofs);
3012 imd->set_editor(get_unicode_string());
3013 int sc = f->get_32();
3014 for (int i = 0; i < sc; i++) {
3015 String src = get_unicode_string();
3016 String md5 = get_unicode_string();
3017 imd->add_source(src, md5);
3018 }
3019 int pc = f->get_32();
3020
3021 for (int i = 0; i < pc; i++) {
3022 String name = get_unicode_string();
3023 Variant val;
3024 parse_variant(val);
3025 imd->set_option(name, val);
3026 }
3027 if (p_return_to_pos) {
3028 f->seek(pos);
3029 }
3030 return OK;
3031}
3032
3033bool ResourceLoaderCompatBinary::should_threaded_load() const {
3034 return use_sub_threads && is_real_load() && ResourceCompatLoader::is_globally_available() && load_type == ResourceCompatLoader::get_default_load_type();

Callers 1

get_resource_infoMethod · 0.80

Calls 5

set_editorMethod · 0.80
add_sourceMethod · 0.80
set_optionMethod · 0.80
get_positionMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected