| 401 | } |
| 402 | |
| 403 | static s32 compile_script(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts) |
| 404 | { |
| 405 | CE_UNUSED(compiler); |
| 406 | |
| 407 | TempAllocator4096 ta; |
| 408 | DynamicString script_resource(ta); |
| 409 | RETURN_IF_ERROR(sjson::parse_string(script_resource, flat_json_object::get(obj, "data.script_resource"))); |
| 410 | RETURN_IF_MISSING(UNIT_COMPILER, "lua" |
| 411 | , script_resource.c_str() |
| 412 | , opts |
| 413 | ); |
| 414 | opts.add_requirement("lua", script_resource.c_str()); |
| 415 | |
| 416 | ScriptDesc sd; |
| 417 | sd.script_resource = RETURN_IF_ERROR(sjson::parse_resource_name(flat_json_object::get(obj, "data.script_resource"))); |
| 418 | strcpy(sd.script_resource_name, script_resource.c_str()); |
| 419 | |
| 420 | FileBuffer fb(output); |
| 421 | BinaryWriter bw(fb); |
| 422 | bw.write(sd.script_resource); |
| 423 | bw.write(sd.script_resource_name); |
| 424 | return 0; |
| 425 | } |
| 426 | |
| 427 | static s32 compile_animation_state_machine(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts) |
| 428 | { |
nothing calls this directly
no test coverage detected