From 706467cde29d2cacab51f5f45c948825849da4ed Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Wed, 25 Dec 2024 21:07:22 +0800 Subject: [PATCH 1/2] hotfix --- src/EcsWorld.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs index fcd6175..8656aef 100644 --- a/src/EcsWorld.cs +++ b/src/EcsWorld.cs @@ -925,6 +925,8 @@ namespace DCFApixels.DragonECS if (itemsCount <= 0) { return 0; } + const int LO_CHANK_HALF = 65535; + const int HI_CHANK_HALF = -65536; const int COMPONENT_MASK_CHUNK_SIZE_HALF = COMPONENT_MASK_CHUNK_SIZE / 2; // проверка на itemsCount <= 0 не обяательна, алгоритм не ломается, // только впустую отрабатыват по всем чанкам, @@ -944,7 +946,7 @@ namespace DCFApixels.DragonECS } else { - if ((chunk & 0x0000FFFF) != 0) + if ((chunk & LO_CHANK_HALF) != 0) { bit = 0x0000_0001; while (bit < 0x0001_0000) @@ -964,7 +966,7 @@ namespace DCFApixels.DragonECS { poolIndex += COMPONENT_MASK_CHUNK_SIZE_HALF; } - if ((chunk & -0x7FFF0000) != 0) + if ((chunk & HI_CHANK_HALF) != 0) { bit = 0x0001_0000; while (bit != 0x0000_0000) @@ -991,6 +993,8 @@ namespace DCFApixels.DragonECS } private unsafe void GetComponentTypeIDsFor_Internal(int entityID, int* componentIDs, int itemsCount) { + const int LO_CHANK_HALF = 65535; + const int HI_CHANK_HALF = -65536; const int COMPONENT_MASK_CHUNK_SIZE_HALF = COMPONENT_MASK_CHUNK_SIZE / 2; // проверка на itemsCount <= 0 не обяательна, алгоритм не ломается, // только впустую отрабатыват по всем чанкам, @@ -1009,7 +1013,7 @@ namespace DCFApixels.DragonECS } else { - if ((chunk & 0x0000FFFF) != 0) + if ((chunk & LO_CHANK_HALF) != 0) { bit = 0x0000_0001; while (bit < 0x0001_0000) @@ -1030,7 +1034,7 @@ namespace DCFApixels.DragonECS { poolIndex += COMPONENT_MASK_CHUNK_SIZE_HALF; } - if ((chunk & -0x7FFF0000) != 0) + if ((chunk & HI_CHANK_HALF) != 0) { bit = 0x0001_0000; while (bit != 0x0000_0000) From 6eacc3e4897b479584de47db4be2a8bd9f2dacbc Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Wed, 25 Dec 2024 21:08:20 +0800 Subject: [PATCH 2/2] up version to 0.8.64 --- DragonECS.csproj | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DragonECS.csproj b/DragonECS.csproj index 802eccf..169856f 100644 --- a/DragonECS.csproj +++ b/DragonECS.csproj @@ -10,7 +10,7 @@ DCFApixels.DragonECS DragonECS - 0.8.63 + 0.8.64 DCFApixels ECS Framework for Game Engines with C# and .Net Platform DCFApixels diff --git a/package.json b/package.json index 4b521eb..75c6171 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "displayName": "DragonECS", "description": "C# Entity Component System Framework", "unity": "2020.3", - "version": "0.8.63", + "version": "0.8.64", "repository": { "type": "git", "url": "https://github.com/DCFApixels/DragonECS.git"