diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-08-05 19:07:06 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-08-06 17:00:26 -0400 |
| commit | 9a48fc73d7a25685fc7917c3edc271f595e093da (patch) | |
| tree | 0f400205af7d419e9f4fb40ebd3ad1db12c49219 /src/asset-manager.hpp | |
| parent | f7d860cee74ad3b94e0d15ea157783b7760f6d55 (diff) | |
pke: first-pass add asset details
Diffstat (limited to 'src/asset-manager.hpp')
| -rw-r--r-- | src/asset-manager.hpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/asset-manager.hpp b/src/asset-manager.hpp index bf065f2..a50aeac 100644 --- a/src/asset-manager.hpp +++ b/src/asset-manager.hpp @@ -36,6 +36,21 @@ const AssetFlags PKE_ASSET_FLAGS_MEM_STATIC = AssetFlags {0x01}; constexpr int64_t EngineDefinedAssetCount = 8; extern AssetKey EngineDefinedAssets[EngineDefinedAssetCount]; +union pke_asset_details { + struct pke_asset_details_shader { + } shader; + struct pke_asset_details_model { + } model; + struct pke_asset_details_texture { + uint32_t width; + uint32_t height; + } texture; + struct pke_asset_details_audio { + } audio; + struct pke_asset_details_font { + } font; +}; + struct Asset { AssetHandle handle{}; AssetKey key = {'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0'}; @@ -47,13 +62,14 @@ struct Asset { AssetLoadingState state = PKE_ASSET_LOADING_STATE_UNLOADED; AssetType type = PKE_ASSET_TYPE_UNSET; AssetFlags flags = PKE_ASSET_FLAGS_NONE; + union pke_asset_details details; }; void AM_Init(); -AssetHandle AM_Register(const AssetKey &key, AssetType type, const void *data, int64_t size, std::size_t alignment); -AssetHandle AM_Register(const char *path, AssetType type); -AssetHandle AM_Register(const AssetKey &key, AssetType type, const char *path); -AssetHandle AM_Register_Static(const AssetKey &key, AssetType type, const void *data, int64_t size); +AssetHandle AM_Register(const AssetKey &key, AssetType type, const void *data, int64_t size, std::size_t alignment, union pke_asset_details *details = nullptr); +AssetHandle AM_Register(const char *path, AssetType type, union pke_asset_details *details = nullptr); +AssetHandle AM_Register(const AssetKey &key, AssetType type, const char *path, union pke_asset_details *details = nullptr); +AssetHandle AM_Register_Static(const AssetKey &key, AssetType type, const void *data, int64_t size, union pke_asset_details *details = nullptr); void AM_Release(AssetHandle assetHandle); const Asset *AM_Get(AssetHandle assetHandle); const AssetHandle AM_GetHandle(const AssetKey &key); |
