| 53 | } |
| 54 | |
| 55 | bool 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 |
no test coverage detected