mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 18:14:37 +08:00
fix filter
This commit is contained in:
parent
738e6a7080
commit
6c3386cb4f
@ -962,29 +962,30 @@ namespace DCFApixels.DragonECS.Internal
|
|||||||
internal const int STACK_BUFFER_THRESHOLD = 100;
|
internal const int STACK_BUFFER_THRESHOLD = 100;
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
internal static void ConvertToChuncks(EcsMaskChunck* ptr, UnsafeArray<int> input, UnsafeArray<EcsMaskChunck> output)
|
internal static void ConvertToChuncks(EcsMaskChunck* bufferPtr, UnsafeArray<int> input, UnsafeArray<EcsMaskChunck> output)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < input.Length; i++)
|
for (int i = 0; i < input.Length; i++)
|
||||||
{
|
{
|
||||||
ptr[i] = EcsMaskChunck.FromID(input.ptr[i]);
|
bufferPtr[i] = EcsMaskChunck.FromID(input.ptr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int inputI = 0, outputI = 0; outputI < output.Length; inputI++, ptr++)
|
for (int inputI = 0, outputI = 0; outputI < output.Length; inputI++, bufferPtr++)
|
||||||
{
|
{
|
||||||
int maskX = ptr->mask;
|
int stackingMask = bufferPtr->mask;
|
||||||
if (maskX == 0) { continue; }
|
if (stackingMask == 0) { continue; }
|
||||||
int chunkIndexX = ptr->chunkIndex;
|
int stackingChunkIndex = bufferPtr->chunkIndex;
|
||||||
|
|
||||||
EcsMaskChunck* subptr = ptr;
|
EcsMaskChunck* bufferSpanPtr = bufferPtr + 1;
|
||||||
for (int j = 1; j < input.Length - inputI; j++, subptr++)
|
for (int j = 1; j < input.Length - inputI; j++, bufferSpanPtr++)
|
||||||
{
|
{
|
||||||
if (subptr->chunkIndex == chunkIndexX)
|
if (bufferSpanPtr->chunkIndex == stackingChunkIndex)
|
||||||
{
|
{
|
||||||
maskX |= subptr->mask;
|
stackingMask |= bufferSpanPtr->mask;
|
||||||
*subptr = default;
|
*bufferSpanPtr = default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
output.ptr[outputI] = new EcsMaskChunck(chunkIndexX, maskX);
|
|
||||||
|
output.ptr[outputI] = new EcsMaskChunck(stackingChunkIndex, stackingMask);
|
||||||
outputI++;
|
outputI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user