Prog on assets
This commit is contained in:
@ -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;
|
||||||
|
@ -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;
|
||||||
|
Reference in New Issue
Block a user