1#ifndef __H__ENGINE_WORLD__
2#define __H__ENGINE_WORLD__
72 "Ruined invariant! Entity at %016lX index %013lX is indexed by %016lX.",
153 vec2i chunk_relative,
162 vec2 chunk_local,
float scale) {
uint64_t u64
Definition defs.h:46
size_t sz
Definition defs.h:51
#define PANIC(msg,...)
Definition defs.h:15
uint32_t u32
Definition defs.h:45
entity_kind_t
Definition entity.h:34
@ ENTITY_KIND_TOMBSTONE
Definition entity.h:36
static void entity_init_construct(entity_t *entity, allocator_t alloc, vec2i chunk_relative, vec2 chunk_local)
Definition entity.h:62
u64 entity_id_t
Definition entity.h:11
static u64 entity_id_new(u32 gen, u64 id)
Definition entity.h:25
static u64 entity_id_get_identity(entity_id_t id)
Definition entity.h:21
static u32 entity_id_get_generation(entity_id_t id)
Definition entity.h:16
entity_kind_t entity_kind_mask_t
Definition entity.h:42
static void entity_init_camera(entity_t *entity, allocator_t alloc, vec2i chunk_relative, vec2 chunk_local, float scale)
Definition entity.h:83
#define list_get_ty_ptr(ty, ls, idx)
Definition list.h:128
#define list_init_ty(ty, ls, alloc)
Definition list.h:36
static void list_cleanup(list_t *ls)
Definition list.h:166
#define list_push_var(ls, var)
Definition list.h:83
static allocator_t allocator_new_malloc()
Wrap malloc into an generic allocator interface.
Definition memory.h:99
A generic allocator type passed by value. Contains a fallback allocator and a set of function pointer...
Definition memory.h:30
entity_kind_mask_t mask
Definition world.h:115
entity_t * entity
Definition world.h:114
sz idx
Definition world.h:113
world_t * world
Definition world.h:112
entity_id_t self_id
Definition entity.h:46
entity_kind_t kind
Definition entity.h:45
sz size
Definition list.h:17
allocator_t allocator
Definition world.h:13
list_t _entities
Definition world.h:14
list_t vacant_entity_ids
Definition world.h:15
static world_t world
Definition world.c:5
static entity_id_t world_reserve_entity_id(world_t *world)
Definition world.h:27
static entity_iter_t world_entity_iter_masked(world_t *world, entity_kind_mask_t mask)
Definition world.h:127
static entity_t * world_spawn_entity_construct(world_t *world, vec2i chunk_relative, vec2 chunk_local)
Definition world.h:152
static void world_init(world_t *world)
Definition world.h:18
static entity_id_t world_spawn_entity(world_t *world)
Definition world.h:45
static void world_cleanup(world_t *world)
Definition world.h:25
static sz world_count_entities(world_t *world)
Definition world.h:80
static entity_t * world_spawn_entity_camera(world_t *world, vec2i chunk_relative, vec2 chunk_local, float scale)
Definition world.h:161
static entity_t * world_get_entity(world_t *world, entity_id_t id)
Definition world.h:57
static bool world_destroy_entity(world_t *world, entity_id_t id)
Definition world.h:86
static bool entity_iter_next(entity_iter_t *it)
Definition world.h:137
static entity_iter_t world_entity_iter(world_t *world)
Definition world.h:118