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

Method _parse_sub_resource

compat/resource_compat_text.cpp:132–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132Error ResourceLoaderCompatText::_parse_sub_resource(VariantParser::Stream *p_stream, Ref<Resource> &r_res, int &line, String &r_err_str) {
133 VariantParser::Token token;
134 VariantParser::get_token(p_stream, token, line, r_err_str);
135 if (token.type != VariantParser::TK_NUMBER && token.type != VariantParser::TK_STRING) {
136 r_err_str = "Expected number (old style sub-resource index) or string";
137 return ERR_PARSE_ERROR;
138 }
139
140 String id = token.value;
141 ERR_FAIL_COND_V(!int_resources.has(id), ERR_INVALID_PARAMETER);
142 r_res = int_resources[id];
143
144 VariantParser::get_token(p_stream, token, line, r_err_str);
145 if (token.type != VariantParser::TK_PARENTHESIS_CLOSE) {
146 r_err_str = "Expected ')'";
147 return ERR_PARSE_ERROR;
148 }
149
150 return OK;
151}
152
153Error ResourceLoaderCompatText::_parse_ext_resource(VariantParser::Stream *p_stream, Ref<Resource> &r_res, int &line, String &r_err_str) {
154 VariantParser::Token token;

Callers 1

_parse_sub_resourcesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected