summaryrefslogtreecommitdiff
path: root/src/asset-manager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/asset-manager.hpp')
-rw-r--r--src/asset-manager.hpp24
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);