2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-02-10 17:43:03 +00:00

refactor: use asset_type_t for ZoneDefinition

This commit is contained in:
Jan
2024-09-29 16:35:09 +02:00
parent d2b4b2dc38
commit b156c7348a
68 changed files with 725 additions and 632 deletions

View File

@@ -259,15 +259,15 @@ XAssetInfoGeneric* GameAssetPoolIW4::GetAsset(const asset_type_t type, const std
#undef CASE_GET_ASSET
}
const char* GameAssetPoolIW4::AssetTypeNameByType(const asset_type_t assetType)
std::optional<const char*> GameAssetPoolIW4::AssetTypeNameByType(const asset_type_t assetType)
{
if (assetType >= 0 && assetType < static_cast<int>(std::extent_v<decltype(ASSET_TYPE_NAMES)>))
return ASSET_TYPE_NAMES[assetType];
return ASSET_TYPE_INVALID;
return std::nullopt;
}
const char* GameAssetPoolIW4::GetAssetTypeName(const asset_type_t assetType) const
std::optional<const char*> GameAssetPoolIW4::GetAssetTypeName(const asset_type_t assetType) const
{
return AssetTypeNameByType(assetType);
}