Change function signatures

This commit is contained in:
Ukendio 2024-05-12 20:44:23 +02:00
parent c4a5f371d1
commit 10f0b8f129

View file

@ -56,9 +56,9 @@ local ECS_ID_FLAGS_MASK = 0x10
local ECS_ENTITY_MASK = bit32.lshift(1, 24) local ECS_ENTITY_MASK = bit32.lshift(1, 24)
local ECS_GENERATION_MASK = bit32.lshift(1, 16) local ECS_GENERATION_MASK = bit32.lshift(1, 16)
local function addFlags(flags) local function addFlags(isPair: boolean)
local typeFlags = 0x0 local typeFlags = 0x0
if flags.isPair then if isPair then
typeFlags = bit32.bor(typeFlags, FLAGS_PAIR) -- HIGHEST bit in the ID. typeFlags = bit32.bor(typeFlags, FLAGS_PAIR) -- HIGHEST bit in the ID.
end end
if false then if false then
@ -121,12 +121,12 @@ local function ECS_PAIR(source: number, target: number)
if source == WILDCARD then if source == WILDCARD then
id = newId(ECS_PAIR_SECOND(target), WILDCARD) id = newId(ECS_PAIR_SECOND(target), WILDCARD)
elseif target == WILDCARD then elseif target == WILDCARD then
id = newId(WILDCARD, ECS_PAIR_SECOND(source)) id = newId(ECS_PAIR_SECOND(source), WILDCARD)
else else
id = newId(ECS_PAIR_SECOND(target), ECS_PAIR_SECOND(source)) id = newId(ECS_PAIR_SECOND(target), ECS_PAIR_SECOND(source))
end end
return id + addFlags({ isPair = true }) return id + addFlags(--[[isPair]] true)
end end
local function getAlive(entityIndex: EntityIndex, id: i53) local function getAlive(entityIndex: EntityIndex, id: i53)
@ -152,8 +152,6 @@ local function nextEntityId(entityIndex, index: i24)
return id return id
end end
local function transitionArchetype( local function transitionArchetype(
entityIndex: EntityIndex, entityIndex: EntityIndex,
to: Archetype, to: Archetype,