Skip to content

Commit

Permalink
Removed VertexType fixed enum from the builtIn classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Selinux24 committed Aug 12, 2024
1 parent 5b1620d commit dd1512a
Show file tree
Hide file tree
Showing 91 changed files with 670 additions and 1,144 deletions.
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Cubemap/Cubemap.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Cubemap;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using Engine.Content;
using SharpDX;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Decals/DecalDrawer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Decals;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using Engine.Content;
using SharpDX;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Foliage/FoliageBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using System;

Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Foliage/FoliagePatch.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Collections;
using Engine.Common;
using SharpDX;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Forward;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using SharpDX;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Engine.BuiltIn.Components.Primitives
namespace Engine.BuiltIn.Components.Geometry
{
/// <summary>
/// Geometry color list drawer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Engine.Common;
using SharpDX;

namespace Engine.BuiltIn.Components.Primitives
namespace Engine.BuiltIn.Components.Geometry
{
/// <summary>
/// Geometry color drawer description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace Engine.BuiltIn.Components.Primitives
namespace Engine.BuiltIn.Components.Geometry
{
/// <summary>
/// Geometry drawer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Engine.Content;
using SharpDX;

namespace Engine.BuiltIn.Components.Primitives
namespace Engine.BuiltIn.Components.Geometry
{
/// <summary>
/// Geometry drawer description
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Ground/Terrain.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Common;
using Engine.BuiltIn.Drawers.Deferred;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using Engine.Content;
using SharpDX;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Ground/TerrainGrid.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Collections.Generic;
using Engine.Common;
using SharpDX;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Model/ModelInstanced.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using SharpDX;
using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Particles/ParticleSystemCPU.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Particles;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using Engine.Content;
using SharpDX;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Particles/ParticleSystemGPU.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Particles;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using Engine.Content;
using SharpDX;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Skies/SkyPlane.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Clouds;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using Engine.Content;
using SharpDX;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Skies/SkyScattering.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.SkyScattering;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using SharpDX;
using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Components/Water/Water.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Engine.BuiltIn.Drawers;
using Engine.BuiltIn.Drawers.Water;
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;
using System.Threading.Tasks;

Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Drawers/Deferred/DeferredDrawerManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;

namespace Engine.BuiltIn.Drawers.Deferred
Expand Down
2 changes: 1 addition & 1 deletion Engine/BuiltIn/Drawers/Forward/ForwardDrawerManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;

namespace Engine.BuiltIn.Drawers.Forward
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Engine.BuiltIn.Primitives;
using Engine.BuiltIn.Format;
using Engine.Common;

namespace Engine.BuiltIn.Drawers.PostProcess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using SharpDX;
using System.Runtime.InteropServices;

namespace Engine.BuiltIn.Primitives
namespace Engine.BuiltIn.Format
{
/// <summary>
/// Billboard vertex format
Expand Down Expand Up @@ -33,54 +33,34 @@ public static EngineInputElement[] Input(int slot)
/// </summary>
public Vector2 Size;

/// <summary>
/// Gets if structure contains data for the specified channel
/// </summary>
/// <param name="channel">Data channel</param>
/// <returns>Returns true if structure contains data for the specified channel</returns>
/// <inheritdoc/>
public readonly bool HasChannel(VertexDataChannels channel)
{
if (channel == VertexDataChannels.Position) return true;
else if (channel == VertexDataChannels.Size) return true;
else return false;
}
/// <summary>
/// Gets data channel value
/// </summary>
/// <typeparam name="T">Data type</typeparam>
/// <param name="channel">Data channel</param>
/// <returns>Returns data for the specified channel</returns>
/// <inheritdoc/>
public readonly T GetChannelValue<T>(VertexDataChannels channel)
{
if (channel == VertexDataChannels.Position) return (T)(object)Position;
else if (channel == VertexDataChannels.Size) return (T)(object)Size;
else throw new EngineException($"Channel data not found: {channel};");
}
/// <summary>
/// Sets the channer value
/// </summary>
/// <typeparam name="T">Data type</typeparam>
/// <param name="channel">Channel</param>
/// <param name="value">Value</param>
/// <inheritdoc/>
public void SetChannelValue<T>(VertexDataChannels channel, T value)
{
if (channel == VertexDataChannels.Position) Position = (Vector3)(object)value;
else if (channel == VertexDataChannels.Size) Size = (Vector2)(object)value;
else throw new EngineException($"Channel data not found: {channel}");
}

/// <summary>
/// Size in bytes
/// </summary>
/// <inheritdoc/>
public readonly int GetStride()
{
return Marshal.SizeOf(typeof(VertexBillboard));
}
/// <summary>
/// Get input elements
/// </summary>
/// <param name="slot">Slot</param>
/// <returns>Returns input elements</returns>
/// <inheritdoc/>
public readonly EngineInputElement[] GetInput(int slot)
{
return Input(slot);
Expand All @@ -91,5 +71,5 @@ public override readonly string ToString()
{
return $"Position: {Position}; Size: {Size};";
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using SharpDX;
using System.Runtime.InteropServices;

namespace Engine.BuiltIn.Primitives
namespace Engine.BuiltIn.Format
{
/// <summary>
/// Particle data buffer
Expand Down Expand Up @@ -42,51 +42,31 @@ public static EngineInputElement[] Input(int slot)
/// </summary>
public float MaxAge;

/// <summary>
/// Gets if structure contains data for the specified channel
/// </summary>
/// <param name="channel">Data channel</param>
/// <returns>Returns true if structure contains data for the specified channel</returns>
/// <inheritdoc/>
public readonly bool HasChannel(VertexDataChannels channel)
{
if (channel == VertexDataChannels.Position) return true;
else return false;
}
/// <summary>
/// Gets data channel value
/// </summary>
/// <typeparam name="T">Data type</typeparam>
/// <param name="channel">Data channel</param>
/// <returns>Returns data for the specified channel</returns>
/// <inheritdoc/>
public readonly T GetChannelValue<T>(VertexDataChannels channel)
{
if (channel == VertexDataChannels.Position) return (T)(object)Position;
else throw new EngineException($"Channel data not found: {channel}");
}
/// <summary>
/// Sets the channer value
/// </summary>
/// <typeparam name="T">Data type</typeparam>
/// <param name="channel">Channel</param>
/// <param name="value">Value</param>
/// <inheritdoc/>
public void SetChannelValue<T>(VertexDataChannels channel, T value)
{
if (channel == VertexDataChannels.Position) Position = (Vector3)(object)value;
else throw new EngineException($"Channel data not found: {channel}");
}

/// <summary>
/// Size in bytes
/// </summary>
/// <inheritdoc/>
public readonly int GetStride()
{
return Marshal.SizeOf(typeof(VertexCpuParticle));
}
/// <summary>
/// Get input elements
/// </summary>
/// <param name="slot">Slot</param>
/// <returns>Returns input elements</returns>
/// <inheritdoc/>
public readonly EngineInputElement[] GetInput(int slot)
{
return Input(slot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using SharpDX;
using System.Runtime.InteropServices;

namespace Engine.BuiltIn.Primitives
namespace Engine.BuiltIn.Format
{
/// <summary>
/// Decal data buffer
Expand Down Expand Up @@ -47,51 +47,31 @@ public static EngineInputElement[] Input(int slot)
/// </summary>
public float MaxAge;

/// <summary>
/// Gets if structure contains data for the specified channel
/// </summary>
/// <param name="channel">Data channel</param>
/// <returns>Returns true if structure contains data for the specified channel</returns>
/// <inheritdoc/>
public readonly bool HasChannel(VertexDataChannels channel)
{
if (channel == VertexDataChannels.Position) return true;
else return false;
}
/// <summary>
/// Gets data channel value
/// </summary>
/// <typeparam name="T">Data type</typeparam>
/// <param name="channel">Data channel</param>
/// <returns>Returns data for the specified channel</returns>
/// <inheritdoc/>
public readonly T GetChannelValue<T>(VertexDataChannels channel)
{
if (channel == VertexDataChannels.Position) return (T)(object)Position;
else throw new EngineException($"Channel data not found: {channel}");
}
/// <summary>
/// Sets the channer value
/// </summary>
/// <typeparam name="T">Data type</typeparam>
/// <param name="channel">Channel</param>
/// <param name="value">Value</param>
/// <inheritdoc/>
public void SetChannelValue<T>(VertexDataChannels channel, T value)
{
if (channel == VertexDataChannels.Position) Position = (Vector3)(object)value;
else throw new EngineException($"Channel data not found: {channel}");
}

/// <summary>
/// Size in bytes
/// </summary>
/// <inheritdoc/>
public readonly int GetStride()
{
return Marshal.SizeOf(typeof(VertexDecal));
}
/// <summary>
/// Get input elements
/// </summary>
/// <param name="slot">Slot</param>
/// <returns>Returns input elements</returns>
/// <inheritdoc/>
public readonly EngineInputElement[] GetInput(int slot)
{
return Input(slot);
Expand Down
Loading

0 comments on commit dd1512a

Please sign in to comment.