Sdk/World: Fix entity block handling
This commit is contained in:
parent
3c99782643
commit
4f6706284e
|
|
@ -266,6 +266,7 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
m_aliveEntities = std::move(world.m_aliveEntities);
|
m_aliveEntities = std::move(world.m_aliveEntities);
|
||||||
m_dirtyEntities = std::move(world.m_dirtyEntities);
|
m_dirtyEntities = std::move(world.m_dirtyEntities);
|
||||||
|
m_entityBlocks = std::move(world.m_entityBlocks);
|
||||||
m_freeIdList = std::move(world.m_freeIdList);
|
m_freeIdList = std::move(world.m_freeIdList);
|
||||||
m_killedEntities = std::move(world.m_killedEntities);
|
m_killedEntities = std::move(world.m_killedEntities);
|
||||||
m_orderedSystems = std::move(world.m_orderedSystems);
|
m_orderedSystems = std::move(world.m_orderedSystems);
|
||||||
|
|
@ -285,7 +286,7 @@ namespace Ndk
|
||||||
|
|
||||||
inline void World::Invalidate()
|
inline void World::Invalidate()
|
||||||
{
|
{
|
||||||
m_dirtyEntities.Resize(m_entities.size(), false);
|
m_dirtyEntities.Resize(m_entityBlocks.size(), false);
|
||||||
m_dirtyEntities.Set(true); // Activation of all bits
|
m_dirtyEntities.Set(true); // Activation of all bits
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,8 @@ namespace Ndk
|
||||||
m_freeIdList.pop_back();
|
m_freeIdList.pop_back();
|
||||||
|
|
||||||
entBlock = &m_entities[id];
|
entBlock = &m_entities[id];
|
||||||
|
entBlock->handle.Reset(&entBlock->entity); //< Reset handle (as it was reset when entity got destroyed)
|
||||||
|
|
||||||
m_entityBlocks[id] = entBlock;
|
m_entityBlocks[id] = entBlock;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -114,6 +116,7 @@ namespace Ndk
|
||||||
// First, destruction of entities, then handles
|
// First, destruction of entities, then handles
|
||||||
// This is made to avoid that handle warn uselessly entities before their destruction
|
// This is made to avoid that handle warn uselessly entities before their destruction
|
||||||
m_entities.clear();
|
m_entities.clear();
|
||||||
|
m_entityBlocks.clear();
|
||||||
|
|
||||||
m_aliveEntities.Clear();
|
m_aliveEntities.Clear();
|
||||||
m_dirtyEntities.Clear();
|
m_dirtyEntities.Clear();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue