2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-05 02:31:55 +00:00

chore: refactor IW4 asset loaders

This commit is contained in:
Jan
2024-12-25 21:39:05 +01:00
parent f9456101e6
commit 7ef944ebd4
139 changed files with 2370 additions and 2965 deletions

View File

@ -25,7 +25,7 @@ public:
std::unique_ptr<XAssetInfoGeneric> CreateXAssetInfo();
private:
protected:
asset_type_t m_type;
std::string m_name;
void* m_asset;
@ -39,6 +39,11 @@ template<typename AssetType> class AssetRegistration : public GenericAssetRegist
static_assert(std::is_base_of_v<IAssetBase, AssetType>);
public:
AssetRegistration(std::string assetName)
: GenericAssetRegistration(AssetType::EnumEntry, std::move(assetName), nullptr)
{
}
AssetRegistration(std::string assetName, typename AssetType::Type* asset)
: GenericAssetRegistration(AssetType::EnumEntry, std::move(assetName), asset)
{
@ -48,4 +53,9 @@ public:
AssetRegistration(AssetRegistration&& other) = default;
AssetRegistration& operator=(const AssetRegistration& other) = delete;
AssetRegistration& operator=(AssetRegistration&& other) noexcept = default;
void SetAsset(typename AssetType::Type* asset)
{
m_asset = asset;
}
};