Prog on assets

This commit is contained in:
2023-04-02 13:26:32 -07:00
parent fb8300f824
commit 17acc2fa3e
2 changed files with 4 additions and 2 deletions

View File

@ -21,7 +21,7 @@ int32_t PrefabAssetParser::onParse(
struct PrefabAsset *out, struct PrefabAsset *out,
std::string *error std::string *error
) { ) {
out->name = values["name"]; out->fileName = values["name"];
if(values["type"] == "texture") { if(values["type"] == "texture") {
out->type = PREFAB_ASSET_TYPE_TEXTURE; out->type = PREFAB_ASSET_TYPE_TEXTURE;

View File

@ -45,7 +45,8 @@ void PrefabGen::generate(
assertUnreachable(); assertUnreachable();
} }
a.usageName = "asset" + std::to_string(assetNumber++); a.usageName = "asset" + std::to_string(assetNumber++);
line(&methodInit.body, "auto " + a.usageName + " = man->get<" + assetType + ">(" + a.fileName + ");", ""); line(&methodInit.body, "auto " + a.usageName + " = man->get<" + assetType + ">(\"" + a.fileName + "\");", "");
line(&methodAssets.body, "assets.push_back(man->get<" + assetType + ">(\"" + a.fileName + "\"));", "");
}; };
// Load self assets // Load self assets
@ -55,6 +56,7 @@ void PrefabGen::generate(
++itAssets; ++itAssets;
} }
// TODO: Load child assets? // TODO: Load child assets?
line(&methodInit.body, "", "");
// Process root and all of its children // Process root and all of its children
int32_t childNumber = 0; int32_t childNumber = 0;