mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Replace 0x10 with ECS_ID_FLAGS_MASK
This commit is contained in:
parent
77069f5fb7
commit
bd6eab315f
1 changed files with 4 additions and 4 deletions
|
@ -104,12 +104,12 @@ end
|
||||||
|
|
||||||
-- HIGH 24 bits LOW 24 bits
|
-- HIGH 24 bits LOW 24 bits
|
||||||
local function ECS_GENERATION(e: i53): i24
|
local function ECS_GENERATION(e: i53): i24
|
||||||
return if e > ECS_ENTITY_MASK then (e // 0x10) % ECS_GENERATION_MASK else 0
|
return if e > ECS_ENTITY_MASK then (e // ECS_ID_FLAGS_MASK) % ECS_GENERATION_MASK else 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local function ECS_GENERATION_INC(e: i53)
|
local function ECS_GENERATION_INC(e: i53)
|
||||||
if e > ECS_ENTITY_MASK then
|
if e > ECS_ENTITY_MASK then
|
||||||
local flags = e // 0x10
|
local flags = e // ECS_ID_FLAGS_MASK
|
||||||
local id = flags // ECS_ENTITY_MASK
|
local id = flags // ECS_ENTITY_MASK
|
||||||
local generation = flags % ECS_GENERATION_MASK
|
local generation = flags % ECS_GENERATION_MASK
|
||||||
|
|
||||||
|
@ -121,12 +121,12 @@ end
|
||||||
|
|
||||||
-- FIRST gets the high ID
|
-- FIRST gets the high ID
|
||||||
local function ECS_ENTITY_T_HI(e: i53): i24
|
local function ECS_ENTITY_T_HI(e: i53): i24
|
||||||
return if e > ECS_ENTITY_MASK then (e // 0x10) % ECS_ENTITY_MASK else e
|
return if e > ECS_ENTITY_MASK then (e // ECS_ID_FLAGS_MASK) % ECS_ENTITY_MASK else e
|
||||||
end
|
end
|
||||||
|
|
||||||
-- SECOND
|
-- SECOND
|
||||||
local function ECS_ENTITY_T_LO(e: i53): i24
|
local function ECS_ENTITY_T_LO(e: i53): i24
|
||||||
return if e > ECS_ENTITY_MASK then (e // 0x10) // ECS_ENTITY_MASK else e
|
return if e > ECS_ENTITY_MASK then (e // ECS_ID_FLAGS_MASK) // ECS_ENTITY_MASK else e
|
||||||
end
|
end
|
||||||
|
|
||||||
local function ECS_PAIR(pred: i53, obj: i53): i53
|
local function ECS_PAIR(pred: i53, obj: i53): i53
|
||||||
|
|
Loading…
Reference in a new issue