Update version support

This commit is contained in:
2025-12-11 21:25:32 +09:00
parent 856fa4f07d
commit a3863c1263
16 changed files with 1699 additions and 332 deletions

View File

@@ -4,8 +4,6 @@
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ include file="Helpers.ttinclude" #>
using Ghost.Core;
namespace Ghost.Entities;
public unsafe partial struct EntityQuery
@@ -30,7 +28,7 @@ public unsafe partial struct EntityQuery
<# for (var localIndex = 0; localIndex < i; localIndex++) { #>
var comp<#= localIndex #>TypeID = ComponentTypeID<T<#= localIndex #>>.value;
<# } #>
var compTypeIDs = stackalloc int[]
{
<# for (var localIndex = 0; localIndex < i; localIndex++) { #>
@@ -51,7 +49,6 @@ public unsafe partial struct EntityQuery
{
if (id == compTypeIDs[i])
{
ComponentRegister.SetComponentLastWrite(id, globalVersion);
changedCompIDs[changedCompCount] = id;
changedCompCount++;
break;
@@ -87,7 +84,7 @@ public unsafe partial struct EntityQuery
for (var j = 0; j < changedCompCount; j++)
{
chunk.MarkChanged(changedCompIDs[i], globalVersion);
archetype.MarkChanged(chunkIndex, changedCompIDs[j], globalVersion);
}
for (var index = 0; index < <#= i #>; index++)