MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / load

Method load

modules/gdscript/gdscript.cpp:3043–3059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3041/*************** RESOURCE ***************/
3042
3043Ref<Resource> ResourceFormatLoaderGDScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) {
3044 Error err;
3045 bool ignoring = p_cache_mode == CACHE_MODE_IGNORE || p_cache_mode == CACHE_MODE_IGNORE_DEEP;
3046 Ref<GDScript> scr = GDScriptCache::get_full_script(p_original_path, err, "", ignoring);
3047
3048 if (err && scr.is_valid()) {
3049 // If !scr.is_valid(), the error was likely from scr->load_source_code(), which already generates an error.
3050 ERR_PRINT_ED(vformat(R"(Failed to load script "%s" with error "%s".)", p_original_path, error_names[err]));
3051 }
3052
3053 if (r_error) {
3054 // Don't fail loading because of parsing error.
3055 *r_error = scr.is_valid() ? OK : err;
3056 }
3057
3058 return scr;
3059}
3060
3061void ResourceFormatLoaderGDScript::get_recognized_extensions(List<String> *p_extensions) const {
3062 p_extensions->push_back("gd");

Callers 8

push_completedMethod · 0.45
pop_completedMethod · 0.45
main.cppFile · 0.45

Calls 2

vformatFunction · 0.85
is_validMethod · 0.45

Tested by

no test coverage detected