summaryrefslogtreecommitdiff
path: root/asset.cpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-27 18:52:48 +1100
committerquou <quou@disroot.org>2024-12-27 18:52:48 +1100
commitd920e5d62020d751ccaa3491cc66275ade749011 (patch)
treee806a95c598e255f9883de98cc350a3b9279d0ce /asset.cpp
parente8c93463b2ae5114f0c88e768e5625abac9d5a50 (diff)
building and running on windows with visual studio
Diffstat (limited to 'asset.cpp')
-rw-r--r--asset.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/asset.cpp b/asset.cpp
index fc6d22b..fc8abde 100644
--- a/asset.cpp
+++ b/asset.cpp
@@ -26,7 +26,7 @@ struct Manager {
}
RLoader* find_loader(const char* magic) {
- uint32_t hash = hash_string(magic);
+ uint32_t hash = fnv1a64((uint8_t*)magic, 4);
int bucket = (int)(hash % max_asset_types);
int i;
for (i = 0; i < max_asset_types; i++) {
@@ -68,6 +68,7 @@ void register_asset_loader(
void Asset_Arena::init(Arena* arena, const char* pack_name) {
p = pack_open(pack_name, arena);
+ assert(p != 0);
a = arena;
s = (Arena*)arena_alloc(a, sizeof *s);
init_arena(