This commit is contained in:
DCFApixels 2025-03-12 17:56:12 +08:00
parent 50691b3309
commit 2d9499cd9e
2 changed files with 6 additions and 9 deletions

View File

@ -176,7 +176,7 @@ namespace DCFApixels.DragonECS.Core
long* ptr = _versions; long* ptr = _versions;
var slots = _world._poolSlots; var slots = _world._poolSlots;
bool result = _maskInc.Length > 0 || _maskExc.Length > 0; bool result = _maskInc.Length != 0 | _maskExc.Length != 0; //тут возможно нужно оптимизировать
foreach (var slotIndex in _maskInc) foreach (var slotIndex in _maskInc)
{ {
ptr++; ptr++;

View File

@ -324,17 +324,14 @@ namespace DCFApixels.DragonECS
#endif #endif
return span; return span;
} }
private bool IsDenseEntitiesDelayedValid()
{
return _isDenseEntitiesDelayedValid;//_itemsCount == _denseEntitiesDelayedCount;
}
private void UpdateDenseEntities() private void UpdateDenseEntities()
{ {
if (IsDenseEntitiesDelayedValid()) { return; } if (_isDenseEntitiesDelayedValid) { return; }
_denseEntitiesDelayedCount = 0; _denseEntitiesDelayedCount = 1;
for (int i = 0, jRight = _itemsCount + 1; i < _capacity; i++) _denseEntitiesDelayed[0] = 0;
for (int i = 1, jRight = _itemsCount + 1; i < _capacity; i++)
{ {
if (_sparseEntities[i] == 0 && i != 0) if (_sparseEntities[i] == 0)
{ {
_denseEntitiesDelayed[jRight] = i; _denseEntitiesDelayed[jRight] = i;
jRight++; jRight++;