Fix error
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using Ghost.Engine.Components;
|
||||||
using Ghost.Engine.Core;
|
using Ghost.Engine.Core;
|
||||||
using Ghost.Entities;
|
using Ghost.Entities;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@@ -124,7 +125,7 @@ public class EditorWorldManager
|
|||||||
{
|
{
|
||||||
// Create runtime entity with SceneID component
|
// Create runtime entity with SceneID component
|
||||||
var entity = _editorWorld.EntityManager.CreateEntity();
|
var entity = _editorWorld.EntityManager.CreateEntity();
|
||||||
_editorWorld.EntityManager.AddComponent(entity, new Components.SceneID { id = sceneNode.Scene.ID });
|
_editorWorld.EntityManager.AddComponent(entity, new SceneID { id = sceneNode.Scene.ID });
|
||||||
|
|
||||||
// Create entity node
|
// Create entity node
|
||||||
var entityNode = new EntityNode(entity, name);
|
var entityNode = new EntityNode(entity, name);
|
||||||
@@ -135,7 +136,7 @@ public class EditorWorldManager
|
|||||||
parent.AddChild(entityNode);
|
parent.AddChild(entityNode);
|
||||||
|
|
||||||
// Add Hierarchy component
|
// Add Hierarchy component
|
||||||
_editorWorld.EntityManager.AddComponent(entity, new Components.Hierarchy
|
_editorWorld.EntityManager.AddComponent(entity, new Hierarchy
|
||||||
{
|
{
|
||||||
parent = parent.Entity,
|
parent = parent.Entity,
|
||||||
firstChild = Entity.Invalid,
|
firstChild = Entity.Invalid,
|
||||||
@@ -147,7 +148,7 @@ public class EditorWorldManager
|
|||||||
sceneNode.AddRootEntity(entityNode);
|
sceneNode.AddRootEntity(entityNode);
|
||||||
|
|
||||||
// Add root hierarchy component
|
// Add root hierarchy component
|
||||||
_editorWorld.EntityManager.AddComponent(entity, Components.Hierarchy.Root);
|
_editorWorld.EntityManager.AddComponent(entity, Hierarchy.Root);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Track entity node
|
// Track entity node
|
||||||
@@ -224,7 +225,7 @@ public class EditorWorldManager
|
|||||||
|
|
||||||
// Build query for entities in this scene
|
// Build query for entities in this scene
|
||||||
var builder = new QueryBuilder();
|
var builder = new QueryBuilder();
|
||||||
builder.WithAll([ComponentTypeID<Components.SceneID>.Value, ComponentTypeID<Components.Hierarchy>.Value]);
|
builder.WithAll([ComponentTypeID<SceneID>.Value, ComponentTypeID<Hierarchy>.Value]);
|
||||||
var queryID = builder.Build(_editorWorld);
|
var queryID = builder.Build(_editorWorld);
|
||||||
ref var query = ref _editorWorld.ComponentManager.GetEntityQueryReference(queryID);
|
ref var query = ref _editorWorld.ComponentManager.GetEntityQueryReference(queryID);
|
||||||
|
|
||||||
@@ -234,7 +235,7 @@ public class EditorWorldManager
|
|||||||
foreach (var chunk in query.GetChunkIterator())
|
foreach (var chunk in query.GetChunkIterator())
|
||||||
{
|
{
|
||||||
var entities = chunk.GetEntities();
|
var entities = chunk.GetEntities();
|
||||||
var sceneIDs = chunk.GetComponentData<Components.SceneID>();
|
var sceneIDs = chunk.GetComponentData<SceneID>();
|
||||||
|
|
||||||
for (int i = 0; i < chunk.Count; i++)
|
for (int i = 0; i < chunk.Count; i++)
|
||||||
{
|
{
|
||||||
@@ -258,8 +259,8 @@ public class EditorWorldManager
|
|||||||
foreach (var chunk in query.GetChunkIterator())
|
foreach (var chunk in query.GetChunkIterator())
|
||||||
{
|
{
|
||||||
var entities = chunk.GetEntities();
|
var entities = chunk.GetEntities();
|
||||||
var sceneIDs = chunk.GetComponentData<Components.SceneID>();
|
var sceneIDs = chunk.GetComponentData<SceneID>();
|
||||||
var hierarchies = chunk.GetComponentData<Components.Hierarchy>();
|
var hierarchies = chunk.GetComponentData<Hierarchy>();
|
||||||
|
|
||||||
for (int i = 0; i < chunk.Count; i++)
|
for (int i = 0; i < chunk.Count; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ public class SceneSerializer
|
|||||||
var componentTypeId = layout.componentID;
|
var componentTypeId = layout.componentID;
|
||||||
|
|
||||||
// Skip SceneID component - it's implicit
|
// Skip SceneID component - it's implicit
|
||||||
if (componentTypeId == ComponentTypeID<SceneID>.Value.Value)
|
if (componentTypeId == ComponentTypeID<SceneID>.Value)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,47 +8,26 @@ internal class EngineEntryAttribute : Attribute
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
internal partial class EngineCoreImpl : IDisposable
|
[EngineEntry]
|
||||||
|
public partial class EngineCore
|
||||||
{
|
{
|
||||||
internal readonly JobScheduler _jobScheduler;
|
private readonly JobScheduler _jobScheduler;
|
||||||
|
|
||||||
internal EngineCoreImpl()
|
public JobScheduler JobScheduler => _jobScheduler;
|
||||||
|
|
||||||
|
internal EngineCore()
|
||||||
{
|
{
|
||||||
_jobScheduler = new JobScheduler(Environment.ProcessorCount - 2); // We -2 here, one for main thread, one for render thread
|
_jobScheduler = new JobScheduler(Environment.ProcessorCount - 2); // We -2 here, one for main thread, one for render thread
|
||||||
}
|
|
||||||
|
|
||||||
internal void IncrementCPUFenceValue()
|
|
||||||
{
|
|
||||||
//GraphicsPipeline.SignalCPUReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
_jobScheduler.Dispose();
|
|
||||||
JobScheduler.ReleaseTempAllocator();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[EngineEntry]
|
|
||||||
public static partial class EngineCore
|
|
||||||
{
|
|
||||||
internal static readonly EngineCoreImpl s_impl;
|
|
||||||
|
|
||||||
public static JobScheduler JobScheduler => s_impl._jobScheduler;
|
|
||||||
|
|
||||||
static EngineCore()
|
|
||||||
{
|
|
||||||
s_impl = new EngineCoreImpl();
|
|
||||||
|
|
||||||
ComponentRegistry.GetOrRegisterComponentID<ManagedEntityRef>();
|
ComponentRegistry.GetOrRegisterComponentID<ManagedEntityRef>();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Init()
|
internal void Init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Dispose()
|
internal void Dispose()
|
||||||
{
|
{
|
||||||
s_impl.Dispose();
|
_jobScheduler.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,12 @@
|
|||||||
<IsTrimmable>True</IsTrimmable>
|
<IsTrimmable>True</IsTrimmable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Services\**" />
|
||||||
|
<EmbeddedResource Remove="Services\**" />
|
||||||
|
<None Remove="Services\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Ghost.Core\Ghost.Core.csproj" />
|
<ProjectReference Include="..\Ghost.Core\Ghost.Core.csproj" />
|
||||||
<ProjectReference Include="..\Ghost.Entities\Ghost.Entities.csproj" />
|
<ProjectReference Include="..\Ghost.Entities\Ghost.Entities.csproj" />
|
||||||
@@ -24,10 +30,6 @@
|
|||||||
<ProjectReference Include="..\Ghost.Graphics\Ghost.Graphics.csproj" />
|
<ProjectReference Include="..\Ghost.Graphics\Ghost.Graphics.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Services\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MemoryPack" Version="1.21.4" />
|
<PackageReference Include="MemoryPack" Version="1.21.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user