mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-26 09:50:02 +00:00
dense should be set at index
This commit is contained in:
parent
d1d5b1f207
commit
52435e62a2
2 changed files with 3 additions and 1 deletions
|
@ -11,7 +11,8 @@ The format is based on [Keep a Changelog][kac], and this project adheres to
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
- `[world]`:
|
- `[world]`:
|
||||||
- Added `world:range` to allow for creating
|
- Added `world:range` to restrict entity range
|
||||||
|
- Changed `world:entity` to accept the overload to create an entity at the desired index
|
||||||
- Changed `world:clear` to also look through the component record for the cleared `ID`
|
- Changed `world:clear` to also look through the component record for the cleared `ID`
|
||||||
- Removes the cleared ID from every entity that has it
|
- Removes the cleared ID from every entity that has it
|
||||||
- Changed entity ID layouts by putting the index in the lower bits, which should make every world function 1-5 nanoseconds faster
|
- Changed entity ID layouts by putting the index in the lower bits, which should make every world function 1-5 nanoseconds faster
|
||||||
|
|
|
@ -778,6 +778,7 @@ local function world_entity(world: ecs_world_t, entity: i53?): i53
|
||||||
local any = dense_array[dense]
|
local any = dense_array[dense]
|
||||||
if any == entity then
|
if any == entity then
|
||||||
if alive_count > dense then
|
if alive_count > dense then
|
||||||
|
r.dense = dense
|
||||||
return entity
|
return entity
|
||||||
end
|
end
|
||||||
local e_swap = dense_array[alive_count]
|
local e_swap = dense_array[alive_count]
|
||||||
|
|
Loading…
Reference in a new issue