passing draw components by ref
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
b6ae9eaebc
commit
6d699e4b17
|
@ -105,7 +105,7 @@ namespace Encompass
|
|||
var queryWithAttribute = GetType().GetCustomAttribute<QueryWith>(false);
|
||||
if (queryWithAttribute != null)
|
||||
{
|
||||
QueryWithTypes = queryWithAttribute.QueryWithTypes.ToHashSet();
|
||||
QueryWithTypes = queryWithAttribute.QueryWithTypes;
|
||||
}
|
||||
|
||||
var queryWithoutAttribute = GetType().GetCustomAttribute<QueryWithout>(false);
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace Encompass
|
|||
/// </summary>
|
||||
public abstract class OrderedRenderer<TComponent> : Renderer where TComponent : struct, IComponent, IDrawableComponent
|
||||
{
|
||||
public abstract void Render(Entity entity, TComponent drawComponent);
|
||||
public abstract void Render(Entity entity, in TComponent drawComponent);
|
||||
|
||||
internal void InternalRender(Entity entity)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<RootNamespace>Encompass</RootNamespace>
|
||||
|
@ -28,5 +28,6 @@
|
|||
<PackageReference Include="MoonTools.Core.Graph" Version="1.0.0" />
|
||||
<PackageReference Include="MoonTools.FastCollections" Version="1.0.0" />
|
||||
<PackageReference Include="System.Collections.Immutable" Version="1.7.0" />
|
||||
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -20,13 +20,13 @@ namespace Tests
|
|||
|
||||
class TestRenderer : OrderedRenderer<TestDrawComponent>
|
||||
{
|
||||
public override void Render(Entity entity, TestDrawComponent testDrawComponent) { }
|
||||
public override void Render(Entity entity, in TestDrawComponent testDrawComponent) { }
|
||||
}
|
||||
|
||||
static bool called = false;
|
||||
class DeactivatedRenderer : TestRenderer
|
||||
{
|
||||
public override void Render(Entity entity, TestDrawComponent testDrawComponent)
|
||||
public override void Render(Entity entity, in TestDrawComponent testDrawComponent)
|
||||
{
|
||||
called = true;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ namespace Tests
|
|||
|
||||
class CalledRenderer : OrderedRenderer<TestDrawComponent>
|
||||
{
|
||||
public override void Render(Entity entity, TestDrawComponent testDrawComponent)
|
||||
public override void Render(Entity entity, in TestDrawComponent testDrawComponent)
|
||||
{
|
||||
resultComponent = (testDrawComponent, entity);
|
||||
calledOnDraw = true;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Tests
|
|||
|
||||
class TestEntityRenderer : OrderedRenderer<TestDrawComponent>
|
||||
{
|
||||
public override void Render(Entity entity, TestDrawComponent testDrawComponent)
|
||||
public override void Render(Entity entity, in TestDrawComponent testDrawComponent)
|
||||
{
|
||||
drawOrder.Add(entity);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue