TTF Loading Fixed

This commit is contained in:
2023-04-27 21:52:19 -07:00
parent e1f615c774
commit 54cfc89f38
13 changed files with 192 additions and 59 deletions

View File

@@ -25,6 +25,8 @@ int32_t PrefabAssetParser::onParse(
if(values["type"] == "texture") {
out->type = PREFAB_ASSET_TYPE_TEXTURE;
} else if(values["type"] == "truetype") {
out->type = PREFAB_ASSET_TYPE_TRUETYPE_FONT;
} else {
*error = "Unknown asset type '" + values["type"] + "'";
return 1;

View File

@@ -8,7 +8,8 @@
namespace Dawn {
enum PrefabAssetType {
PREFAB_ASSET_TYPE_TEXTURE
PREFAB_ASSET_TYPE_TEXTURE,
PREFAB_ASSET_TYPE_TRUETYPE_FONT
};
struct PrefabAsset {

View File

@@ -44,6 +44,11 @@ void PrefabGen::generate(
assetMap[a.fileName] = "&" + a.usageName + "->texture";
break;
case PREFAB_ASSET_TYPE_TRUETYPE_FONT:
assetType = "TrueTypeAsset";
assetMap[a.fileName] = "&" + a.usageName + "->font";
break;
default:
assertUnreachable();
}