MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / Cook

Method Cook

modules/tools/tool_core/src/assets/config_asset.cpp:55–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55bool SConfigCooker::Cook(SCookContext* ctx)
56{
57 const auto outputPath = ctx->GetOutputPath();
58 // const auto assetRecord = ctx->GetAssetRecord();
59 //-----load config
60 // no cook config for config, skipping
61 //-----import resource object
62 auto resource = ctx->Import<skr_config_resource_t>();
63 if(!resource)
64 return false;
65 SKR_DEFER({ ctx->Destroy(resource); });
66 //-----emit dependencies
67 // no static dependencies
68 //-----cook resource
69 // no cook needed for config, just binarize it
70 //-----fetch runtime dependencies
71 // TODO. resume it
72 // auto type = (skr::type::RecordType*)skr_get_type(&resource->configType);
73 // for (auto& field : type->GetFields())
74 // {
75 // if (field.type->Same(skr::type::type_of<skr_resource_handle_t>::get()))
76 // {
77 // auto handle = (skr_resource_handle_t*)((char*)resource->configData + field.offset);
78 // if (handle->is_null())
79 // continue;
80 // ctx->AddRuntimeDependency(handle->get_guid());
81 // }
82 // }
83 ctx->Save(*resource);
84 return true;
85}
86} // namespace asset
87} // namespace skd

Callers 1

AddCookTaskMethod · 0.45

Calls 3

GetOutputPathMethod · 0.80
DestroyMethod · 0.45
SaveMethod · 0.45

Tested by

no test coverage detected