From 4512245e57e5d947bfdc57446edc0e9cfeb781f0 Mon Sep 17 00:00:00 2001
From: DCFApixels <99481254+DCFApixels@users.noreply.github.com>
Date: Tue, 26 Aug 2025 15:50:11 +0800
Subject: [PATCH] hot fix up version to 0.9.20
---
DragonECS.csproj | 2 +-
package.json | 2 +-
src/Collections/EcsGroup.cs | 6 ++---
src/Collections/EcsSpan.cs | 4 +--
src/EcsMask.cs | 4 +--
src/EcsPipeline.Builder.cs | 4 +--
src/EcsWorld.cs | 8 +++---
src/EcsWorld.static.cs | 6 ++---
src/Executors/MaskQueryExecutor.cs | 2 +-
src/Injections/Injector.cs | 6 ++---
src/Internal/ArrayUtility.cs | 41 +++++++++++++++++++-----------
src/Internal/IdDispenser.cs | 2 +-
src/Internal/StructList.cs | 6 ++---
src/Pools/EcsPool.cs | 6 ++---
14 files changed, 55 insertions(+), 44 deletions(-)
diff --git a/DragonECS.csproj b/DragonECS.csproj
index a597b72..44dcf4f 100644
--- a/DragonECS.csproj
+++ b/DragonECS.csproj
@@ -10,7 +10,7 @@
DCFApixels.DragonECS
DragonECS
- 0.9.19
+ 0.9.20
DCFApixels
ECS Framework for Game Engines with C# and .Net Platform
DCFApixels
diff --git a/package.json b/package.json
index eab1673..e596002 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"displayName": "DragonECS",
"description": "C# Entity Component System Framework",
"unity": "2020.3",
- "version": "0.9.19",
+ "version": "0.9.20",
"repository": {
"type": "git",
"url": "https://github.com/DCFApixels/DragonECS.git"
diff --git a/src/Collections/EcsGroup.cs b/src/Collections/EcsGroup.cs
index b7b2cce..ee7fd30 100644
--- a/src/Collections/EcsGroup.cs
+++ b/src/Collections/EcsGroup.cs
@@ -442,7 +442,7 @@ namespace DCFApixels.DragonECS
{
if (++_count >= _dense.Length)
{
- Array.Resize(ref _dense, ArrayUtility.NextPow2(_count << 1));
+ Array.Resize(ref _dense, ArrayUtility.NextPow2(_count));
}
_dense[_count] = entityID;
@@ -576,7 +576,7 @@ namespace DCFApixels.DragonECS
{
if (minSize >= _dense.Length)
{
- Array.Resize(ref _dense, ArrayUtility.NextPow2_ClampOverflow(minSize));
+ Array.Resize(ref _dense, ArrayUtility.CeilPow2_ClampOverflow(minSize));
}
}
@@ -663,7 +663,7 @@ namespace DCFApixels.DragonECS
{
if (dynamicBuffer.Length < _count)
{
- Array.Resize(ref dynamicBuffer, ArrayUtility.NextPow2(_count));
+ Array.Resize(ref dynamicBuffer, ArrayUtility.CeilPow2(_count));
}
int i = 0;
foreach (var e in this)
diff --git a/src/Collections/EcsSpan.cs b/src/Collections/EcsSpan.cs
index 86a0ce2..d68ee27 100644
--- a/src/Collections/EcsSpan.cs
+++ b/src/Collections/EcsSpan.cs
@@ -98,7 +98,7 @@ namespace DCFApixels.DragonECS
{
if (dynamicBuffer.Length < _values.Length)
{
- Array.Resize(ref dynamicBuffer, ArrayUtility.NextPow2(_values.Length));
+ Array.Resize(ref dynamicBuffer, ArrayUtility.CeilPow2(_values.Length));
}
int i = 0;
foreach (var e in this)
@@ -247,7 +247,7 @@ namespace DCFApixels.DragonECS
{
if (dynamicBuffer.Length < _source.Count)
{
- Array.Resize(ref dynamicBuffer, ArrayUtility.NextPow2(_source.Count));
+ Array.Resize(ref dynamicBuffer, ArrayUtility.CeilPow2(_source.Count));
}
int i = 0;
foreach (var e in this)
diff --git a/src/EcsMask.cs b/src/EcsMask.cs
index 3521ad0..2aa5376 100644
--- a/src/EcsMask.cs
+++ b/src/EcsMask.cs
@@ -75,7 +75,7 @@ namespace DCFApixels.DragonECS
get { return _anys; }
}
public EcsMaskFlags Flags
- {
+ {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get { return _flags; }
}
@@ -876,7 +876,7 @@ namespace DCFApixels.DragonECS
}
}
- if(_sortAnyChunckBuffer.Length != 0)
+ if (_sortAnyChunckBuffer.Length != 0)
{
for (int i = 0; i < _sortAnyChunckBuffer.Length; i++)
{
diff --git a/src/EcsPipeline.Builder.cs b/src/EcsPipeline.Builder.cs
index 64b6309..e06c7ae 100644
--- a/src/EcsPipeline.Builder.cs
+++ b/src/EcsPipeline.Builder.cs
@@ -245,7 +245,7 @@ namespace DCFApixels.DragonECS
Configs.Instance.Set(config.Key, config.Value);
}
Layers.MergeWith(other.Layers);
-
+
foreach (ref readonly SystemNode otherRecord in new LinkedListCountIterator(_systemNodes, _systemNodesCount, _startIndex))
{
AddNode_Internal(otherRecord.system, otherRecord.layerName, otherRecord.sortOrder, otherRecord.isUnique);
@@ -351,7 +351,7 @@ namespace DCFApixels.DragonECS
//}
}
-
+
IEcsProcess[] allSystems = new IEcsProcess[allSystemsLength];
{
int i = 0;
diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs
index 441dab5..2ce52bb 100644
--- a/src/EcsWorld.cs
+++ b/src/EcsWorld.cs
@@ -205,12 +205,12 @@ namespace DCFApixels.DragonECS
_poolsMediator = new PoolsMediator(this);
- int poolsCapacity = ArrayUtility.NextPow2(config.PoolsCapacity);
+ int poolsCapacity = ArrayUtility.CeilPow2Safe(config.PoolsCapacity);
_pools = new IEcsPoolImplementation[poolsCapacity];
_poolSlots = new PoolSlot[poolsCapacity];
ArrayUtility.Fill(_pools, _nullPool);
- int entitiesCapacity = ArrayUtility.NextPow2(config.EntitiesCapacity);
+ int entitiesCapacity = ArrayUtility.CeilPow2Safe(config.EntitiesCapacity);
_entityDispenser = new IdDispenser(entitiesCapacity, 0, OnEntityDispenserResized);
_executorCoures = new Dictionary<(Type, object), IQueryExecutorImplementation>(config.PoolComponentsCapacity);
@@ -570,12 +570,12 @@ namespace DCFApixels.DragonECS
count++;
}
}
- if(count == 0)
+ if (count == 0)
{
return false;
}
}
-
+
return true;
}
bool deepDebug = IsMatchesMaskDeepDebug(mask, entityID);
diff --git a/src/EcsWorld.static.cs b/src/EcsWorld.static.cs
index fbb52d7..033321a 100644
--- a/src/EcsWorld.static.cs
+++ b/src/EcsWorld.static.cs
@@ -235,9 +235,9 @@ namespace DCFApixels.DragonECS
}
ref short itemIndex = ref _mapping[worldID];
#if DEBUG && DRAGONECS_DEEP_DEBUG
- if (itemIndex >= _worlds.Length)
- {
- Throw.UndefinedException();
+ if (itemIndex >= _worlds.Length)
+ {
+ Throw.UndefinedException();
}
#endif
if (itemIndex != 0)
diff --git a/src/Executors/MaskQueryExecutor.cs b/src/Executors/MaskQueryExecutor.cs
index 9008aad..e835c66 100644
--- a/src/Executors/MaskQueryExecutor.cs
+++ b/src/Executors/MaskQueryExecutor.cs
@@ -157,7 +157,7 @@ namespace DCFApixels.DragonECS.Core
var slots = _world._poolSlots;
for (int i = 1; i < _count; i++)
{
- if(_versions[i] == slots[_componentIDs[i]].version)
+ if (_versions[i] == slots[_componentIDs[i]].version)
{
return false;
}
diff --git a/src/Injections/Injector.cs b/src/Injections/Injector.cs
index 8786867..df558b0 100644
--- a/src/Injections/Injector.cs
+++ b/src/Injections/Injector.cs
@@ -16,7 +16,7 @@ namespace DCFApixels.DragonECS
private readonly Dictionary _nodes = new Dictionary(32);
private ReadOnlySpan GetNodes(Type type)
{
- if(_branches.TryGetValue(type, out InjectionBranch branch))
+ if (_branches.TryGetValue(type, out InjectionBranch branch))
{
return branch.Nodes;
}
@@ -34,7 +34,7 @@ namespace DCFApixels.DragonECS
private ReadOnlySpan