Sync to released Jecs 0.5.5-nightly.20250428T001101Z (#47)

Reviewed-on: #47
This commit is contained in:
marked 2025-04-28 02:11:21 +02:00
parent 5acca197e0
commit b14776aa3d
7 changed files with 22 additions and 34 deletions

View file

@ -1,2 +1,2 @@
modified = ["jecs.luau"]
version = "0.5.5-nightly.20250427T001102Z"
version = "0.5.5-nightly.20250428T001101Z"

View file

@ -772,38 +772,26 @@ local function world_entity(world: ecs_world_t, entity: i53?): i53
local r = sparse_array[index]
if r then
local dense = r.dense
if not dense or dense == 0 then
if not dense or r.dense == 0 then
r.dense = index
dense = index
end
local any = dense_array[dense]
if any == entity then
if alive_count > dense then
r.dense = dense
return entity
end
local e_swap = dense_array[alive_count]
local r_swap = sparse_array[alive_count]
r_swap.dense = dense
r.dense = alive_count
dense_array[alive_count] = entity
dense_array[dense] = e_swap
return entity
end
-- assert(any ~= 0) should never happen
local e_swap = dense_array[alive_count]
local r_swap = sparse_array[alive_count]
if dense <= alive_count then
return any
end
local e_swap = dense_array[dense]
local r_swap = entity_index_try_get_any(entity_index, e_swap) :: ecs_record_t
alive_count += 1
entity_index.alive_count = alive_count
end
r_swap.dense = dense
r.dense = alive_count
dense_array[alive_count] = any
dense_array[dense] = e_swap
dense_array[alive_count] = any
return any
else
for i = max_id + 1, index do

View file

@ -3,7 +3,7 @@ includes = ["init.luau", "pesde.toml", "README.md", "CHANGELOG.md", "LICENSE", "
license = "MIT"
name = "marked/jecs_nightly"
repository = "https://git.devmarked.win/marked/jecs-nightly"
version = "0.5.5-nightly.20250427T001102Z"
version = "0.5.5-nightly.20250428T001101Z"
[indices]
default = "https://github.com/pesde-pkg/index"

View file

@ -3,7 +3,7 @@ includes = ["init.luau", "pesde.toml", "README.md", "CHANGELOG.md", "LICENSE", "
license = "MIT"
name = "marked/jecs_nightly"
repository = "https://git.devmarked.win/marked/jecs-nightly"
version = "0.5.5-nightly.20250427T001102Z"
version = "0.5.5-nightly.20250428T001101Z"
[indices]
default = "https://github.com/pesde-pkg/index"

View file

@ -1,2 +1,2 @@
passed = true
timestamp = "20250427T001104Z"
timestamp = "20250428T001103Z"

View file

@ -1,7 +1,6 @@
7.2 us  2 kB│ delete children of entity
9.2 us  1 kB│ remove friends of entity
349 ns  0  B│ simple deletion of entity
*created e1000v0
7.6 us  2 kB│ delete children of entity
9.1 us  1 kB│ remove friends of entity
346 ns  0  B│ simple deletion of entity
world:add()
PASS│ idempotent
PASS│ archetype move
@ -39,7 +38,8 @@
PASS│ 
world:range()
PASS│ 
PASS│ under range start
PASS│ over range start
world:entity()
PASS│ desired id
@ -118,5 +118,5 @@
PASS│ #2
PASS│ #3
72/72 test cases passed in 32.525 ms.
73/73 test cases passed in 33.504 ms.
0 fails

View file

@ -5,4 +5,4 @@ license = "MIT"
name = "mark-marks/jecs-nightly"
realm = "shared"
registry = "https://github.com/UpliftGames/wally-index"
version = "0.5.5-nightly.20250427T001102Z"
version = "0.5.5-nightly.20250428T001101Z"