| 2998 | } |
| 2999 | |
| 3000 | Error 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 | |
| 3033 | bool ResourceLoaderCompatBinary::should_threaded_load() const { |
| 3034 | return use_sub_threads && is_real_load() && ResourceCompatLoader::is_globally_available() && load_type == ResourceCompatLoader::get_default_load_type(); |
no test coverage detected