diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-08-22 21:11:52 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-08-22 21:11:52 -0400 |
| commit | b385ee5094df02e55aea3a3057ce2463d8fd20c0 (patch) | |
| tree | eec107af4da003187fbf43b1a6ffa551f6621cce /src/asset-manager.hpp | |
| parent | eb8faedd1b7aa5f57c22feda430ae7be14d419ff (diff) | |
AssetManager handles files gracefully
We're bypassing memcpy for files because we haven't read the file
yet, and we also don't want to copy the file's data around
multiple times when it isn't necessary.
Diffstat (limited to 'src/asset-manager.hpp')
| -rw-r--r-- | src/asset-manager.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/asset-manager.hpp b/src/asset-manager.hpp index 2354cba..8a45d48 100644 --- a/src/asset-manager.hpp +++ b/src/asset-manager.hpp @@ -4,6 +4,7 @@ #include "macros.hpp" #include "memory.hpp" +#include <fstream> #include <cstdint> #include <cstring> #include <cassert> @@ -18,7 +19,7 @@ struct Asset{ void AssetManagerInit(); AssetHandle RegisterAsset(const void *data, int64_t size, const char *key); -AssetHandle RegisterAsset(char *path); +AssetHandle RegisterAsset(const char *path); void DestroyAsset(AssetHandle assetHandle); const Asset *GetAsset(AssetHandle assetHandle); |
