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

Function compile_animation_state_machine

src/resource/unit_compiler.cpp:427–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427static s32 compile_animation_state_machine(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts)
428{
429 CE_UNUSED(compiler);
430
431 TempAllocator4096 ta;
432 DynamicString state_machine_resource(ta);
433 RETURN_IF_ERROR(sjson::parse_string(state_machine_resource, flat_json_object::get(obj, "data.state_machine_resource")));
434 WARN_IF_MISSING(UNIT_COMPILER, "state_machine"
435 , state_machine_resource.c_str()
436 , opts
437 );
438 opts.add_requirement("state_machine", state_machine_resource.c_str());
439
440 AnimationStateMachineDesc asmd;
441 asmd.state_machine_resource = RETURN_IF_ERROR(sjson::parse_resource_name(flat_json_object::get(obj, "data.state_machine_resource")));
442
443 FileBuffer fb(output);
444 BinaryWriter bw(fb);
445 bw.write(asmd.state_machine_resource);
446 return 0;
447}
448
449static s32 compile_fog(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts)
450{

Callers

nothing calls this directly

Calls 6

getFunction · 0.85
parse_resource_nameFunction · 0.85
add_requirementMethod · 0.80
parse_stringFunction · 0.50
c_strMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected