MCPcopy Create free account
hub / github.com/crownengine/crown / parse_internal

Function parse_internal

src/resource/mesh.cpp:531–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529 }
530
531 static s32 parse_internal(Mesh &m, Buffer &buf, CompileOptions &opts)
532 {
533 TempAllocator4096 ta;
534 JsonObject obj(ta);
535 RETURN_IF_ERROR(sjson::parse(obj, buf));
536
537 DynamicString source(ta);
538 if (json_object::has(obj, "source")) {
539 RETURN_IF_ERROR(sjson::parse_string(source, obj["source"]));
540
541 RETURN_IF_FILE_MISSING(MESH, source.c_str(), opts);
542 if (str_has_suffix_case(source.c_str(), ".obj"))
543 return crown::obj::parse(m, source.c_str(), opts);
544
545 Buffer fbx_buf = opts.read(source.c_str());
546 return fbx::parse(m, fbx_buf, opts);
547 } else {
548 return mesh::parse(m, buf, opts);
549 }
550 }
551
552 s32 parse(Mesh &m, const char *path, CompileOptions &opts)
553 {

Callers 1

parseFunction · 0.70

Calls 5

parseFunction · 0.70
hasFunction · 0.50
parse_stringFunction · 0.50
c_strMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected