Refactor rendering projects
This commit is contained in:
@@ -208,10 +208,10 @@ public class ComponentManager : IDisposable
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal Identifier<EntityQuery> CreateEntityQuery(EntityQueryMask mask, int maskHash)
|
||||
internal Identifier<EntityQuery> CreateEntityQuery(ref readonly EntityQueryMask mask, int maskHash)
|
||||
{
|
||||
var queryID = new Identifier<EntityQuery>(_entityQueries.Count);
|
||||
_entityQueries.Add(new EntityQuery(queryID, _world.ID, mask));
|
||||
_entityQueries.Add(new EntityQuery(queryID, _world.ID, in mask));
|
||||
_querieLookup.Add(maskHash, queryID);
|
||||
|
||||
ref var query = ref _entityQueries[queryID.Value];
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Ghost.Core;
|
||||
using Misaki.HighPerformance.Jobs;
|
||||
using Misaki.HighPerformance.LowLevel.Collections;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -64,7 +63,7 @@ public unsafe partial struct EntityQuery
|
||||
{
|
||||
ref var arch = ref world.ComponentManager.GetArchetypeReference(archID);
|
||||
|
||||
for (int i = 0; i < arch.ChunkCount; i++)
|
||||
for (var i = 0; i < arch.ChunkCount; i++)
|
||||
{
|
||||
var pChunk = (Chunk*)arch._chunks.GetUnsafePtr() + i;
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ public unsafe partial struct EntityQuery : IDisposable
|
||||
private readonly Identifier<EntityQuery> _id;
|
||||
private readonly Identifier<World> _worldID;
|
||||
|
||||
internal EntityQuery(Identifier<EntityQuery> id, Identifier<World> worldID, EntityQueryMask mask)
|
||||
internal EntityQuery(Identifier<EntityQuery> id, Identifier<World> worldID, ref readonly EntityQueryMask mask)
|
||||
{
|
||||
_id = id;
|
||||
_worldID = worldID;
|
||||
@@ -632,7 +632,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
// NOTE: We do not dispose the mask here, as it is now owned by the EntityQuery.
|
||||
queryID = world.ComponentManager.CreateEntityQuery(mask, maskHash);
|
||||
queryID = world.ComponentManager.CreateEntityQuery(in mask, maskHash);
|
||||
|
||||
Return:
|
||||
Dispose();
|
||||
|
||||
Reference in New Issue
Block a user