Merge branch 'main' into dev

This commit is contained in:
DCFApixels 2024-12-27 01:45:31 +08:00
commit 44ef6418af
3 changed files with 10 additions and 6 deletions

View File

@ -10,7 +10,7 @@
<RootNamespace>DCFApixels.DragonECS</RootNamespace>
<Title>DragonECS</Title>
<Version>0.8.63</Version>
<Version>0.8.64</Version>
<Authors>DCFApixels</Authors>
<Description>ECS Framework for Game Engines with C# and .Net Platform</Description>
<Copyright>DCFApixels</Copyright>

View File

@ -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"

View File

@ -952,6 +952,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 не обяательна, алгоритм не ломается,
// только впустую отрабатыват по всем чанкам,
@ -971,7 +973,7 @@ namespace DCFApixels.DragonECS
}
else
{
if ((chunk & 0x0000FFFF) != 0)
if ((chunk & LO_CHANK_HALF) != 0)
{
bit = 0x0000_0001;
while (bit < 0x0001_0000)
@ -991,7 +993,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)
@ -1018,6 +1020,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 не обяательна, алгоритм не ломается,
// только впустую отрабатыват по всем чанкам,
@ -1036,7 +1040,7 @@ namespace DCFApixels.DragonECS
}
else
{
if ((chunk & 0x0000FFFF) != 0)
if ((chunk & LO_CHANK_HALF) != 0)
{
bit = 0x0000_0001;
while (bit < 0x0001_0000)
@ -1057,7 +1061,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)