potential fix v2
This commit is contained in:
parent
d575db6f37
commit
ec704e9814
@ -64,10 +64,7 @@ buffer_for_fetch :: (type: Fetch_Type) -> (*u8, u64) {
|
|||||||
|
|
||||||
fetch_callback :: (res: *sfetch_response_t) #c_call {
|
fetch_callback :: (res: *sfetch_response_t) #c_call {
|
||||||
push_context,defer_pop default_context;
|
push_context,defer_pop default_context;
|
||||||
handle_fetch_response(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
handle_fetch_response :: (res: *sfetch_response_t) {
|
|
||||||
req := g_asset_manager.current_fetch;
|
req := g_asset_manager.current_fetch;
|
||||||
g_asset_manager.is_fetching = false;
|
g_asset_manager.is_fetching = false;
|
||||||
if req.type == {
|
if req.type == {
|
||||||
@ -81,7 +78,7 @@ handle_fetch_response :: (res: *sfetch_response_t) {
|
|||||||
memcpy(mem.data, res.data.ptr, res.data.size.(s64));
|
memcpy(mem.data, res.data.ptr, res.data.size.(s64));
|
||||||
pack: Loaded_Pack;
|
pack: Loaded_Pack;
|
||||||
pack.nameHash = hash.get_hash(req.pack_name);
|
pack.nameHash = hash.get_hash(req.pack_name);
|
||||||
pack.name = req.pack_name;
|
pack.name = sprint("%", req.pack_name);
|
||||||
success := init_from_memory(*pack.content, mem, sprint("%", req.pack_name));
|
success := init_from_memory(*pack.content, mem, sprint("%", req.pack_name));
|
||||||
if !success { log_error("Failed to load pack!!"); return; }
|
if !success { log_error("Failed to load pack!!"); return; }
|
||||||
add_resources_from_pack(*pack);
|
add_resources_from_pack(*pack);
|
||||||
|
|||||||
@ -136,6 +136,7 @@ unload_current_world :: () {
|
|||||||
Pool.reset(*current_world.pool);
|
Pool.reset(*current_world.pool);
|
||||||
current_world.valid = false;
|
current_world.valid = false;
|
||||||
} else {
|
} else {
|
||||||
|
print("Setting allocators on current world!!\n");
|
||||||
Pool.set_allocators(*current_world.pool);
|
Pool.set_allocators(*current_world.pool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user