2024-09-11 10:16:57 +00:00
|
|
|
#include <voxula/internals/ecs/lookup.h>
|
2024-09-12 21:27:12 +00:00
|
|
|
#include <voxula/internals/ecs/tag.h>
|
2024-09-11 10:16:57 +00:00
|
|
|
#include <voxula/internals/ecs/head.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2024-09-12 21:27:12 +00:00
|
|
|
vecs_s * vecs_new(vx_uuid_table_s *uuid_table)
|
2024-09-11 10:16:57 +00:00
|
|
|
{
|
2024-09-14 12:25:49 +00:00
|
|
|
if( ! uuid_table)
|
|
|
|
{
|
|
|
|
uuid_table = vx_new_uuid_table();
|
|
|
|
}
|
2024-09-11 10:16:57 +00:00
|
|
|
vecs_s *ecs = malloc(sizeof(vecs_s));
|
2024-09-12 21:27:12 +00:00
|
|
|
ecs->resolver = vecs_create_tag_name_resolver(uuid_table);
|
|
|
|
ecs->lookup_map = vecs_create_lookup_map(uuid_table);
|
2024-09-11 10:16:57 +00:00
|
|
|
ecs->shadow_pool = vx_new_pool(sizeof(vecs_shadow_s), 8192);
|
|
|
|
ecs->tag_pool = vx_new_pool(sizeof(vecs_tag_s), 32768);
|
2024-09-12 21:27:12 +00:00
|
|
|
ecs->uuid_table = uuid_table;
|
2024-09-11 10:16:57 +00:00
|
|
|
return ecs;
|
|
|
|
}
|
|
|
|
|
|
|
|
void vecs_free(vecs_s *ecs)
|
|
|
|
{
|
|
|
|
vecs_delete_tag_name_resolver(&ecs->resolver);
|
|
|
|
vx_free_pool(ecs->shadow_pool);
|
|
|
|
vx_free_pool(ecs->tag_pool);
|
|
|
|
}
|