Change renderables to class to avoid boxing
This commit is contained in:
@@ -14,7 +14,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Graphics
|
||||
{
|
||||
public struct SpriteRenderable : IPalettedRenderable, IModifyableRenderable, IFinalizedRenderable
|
||||
public class SpriteRenderable : IPalettedRenderable, IModifyableRenderable, IFinalizedRenderable
|
||||
{
|
||||
public static readonly IEnumerable<IRenderable> None = new IRenderable[0];
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Graphics
|
||||
{
|
||||
public struct TargetLineRenderable : IRenderable, IFinalizedRenderable
|
||||
public class TargetLineRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly IEnumerable<WPos> waypoints;
|
||||
readonly Color color;
|
||||
|
||||
@@ -13,7 +13,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Graphics
|
||||
{
|
||||
public struct UISpriteRenderable : IRenderable, IPalettedRenderable, IFinalizedRenderable
|
||||
public class UISpriteRenderable : IRenderable, IPalettedRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly Sprite sprite;
|
||||
readonly WPos effectiveWorldPos;
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Graphics
|
||||
{
|
||||
struct TeslaZapRenderable : IPalettedRenderable, IFinalizedRenderable
|
||||
class TeslaZapRenderable : IPalettedRenderable, IFinalizedRenderable
|
||||
{
|
||||
static int[][] steps = new[]
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Primitives;
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public enum BeamRenderableShape { Cylindrical, Flat }
|
||||
public struct BeamRenderable : IRenderable, IFinalizedRenderable
|
||||
public class BeamRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly WPos pos;
|
||||
readonly int zOffset;
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct CircleAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class CircleAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
const int CircleSegments = 32;
|
||||
static readonly WVec[] FacingOffsets = Exts.MakeArray(CircleSegments, i => new WVec(1024, 0, 0).Rotate(WRot.FromFacing(i * 256 / CircleSegments)));
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct ContrailRenderable : IRenderable, IFinalizedRenderable
|
||||
public class ContrailRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
public int Length { get { return trail.Length; } }
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct DetectionCircleAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class DetectionCircleAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly WPos centerPosition;
|
||||
readonly WDist radius;
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct IsometricSelectionBarsAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class IsometricSelectionBarsAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
const int BarWidth = 3;
|
||||
const int BarHeight = 4;
|
||||
@@ -40,7 +40,6 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
}
|
||||
|
||||
public IsometricSelectionBarsAnnotationRenderable(WPos pos, Actor actor, Polygon bounds)
|
||||
: this()
|
||||
{
|
||||
this.pos = pos;
|
||||
this.actor = actor;
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct IsometricSelectionBoxAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class IsometricSelectionBoxAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
static readonly float2 TLOffset = new float2(-12, -6);
|
||||
static readonly float2 TROffset = new float2(12, -6);
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct LineAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class LineAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly WPos start;
|
||||
readonly WPos end;
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct ModelRenderable : IPalettedRenderable, IModifyableRenderable
|
||||
public class ModelRenderable : IPalettedRenderable, IModifyableRenderable
|
||||
{
|
||||
readonly IEnumerable<ModelAnimation> models;
|
||||
readonly WPos pos;
|
||||
@@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
return new FinalizedModelRenderable(wr, this);
|
||||
}
|
||||
|
||||
struct FinalizedModelRenderable : IFinalizedRenderable
|
||||
class FinalizedModelRenderable : IFinalizedRenderable
|
||||
{
|
||||
readonly ModelRenderable model;
|
||||
readonly ModelRenderProxy renderProxy;
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct PolygonAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class PolygonAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly WPos[] vertices;
|
||||
readonly WPos effectivePos;
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct RailgunHelixRenderable : IRenderable, IFinalizedRenderable
|
||||
public class RailgunHelixRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly WPos pos;
|
||||
readonly int zOffset;
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct RangeCircleAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class RangeCircleAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
const int RangeCircleSegments = 32;
|
||||
static readonly Int32Matrix4x4[] RangeCircleStartRotations = Exts.MakeArray(RangeCircleSegments, i => WRot.FromFacing(8 * i).AsMatrix());
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct SelectionBarsAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class SelectionBarsAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly WPos pos;
|
||||
readonly Actor actor;
|
||||
@@ -31,7 +31,6 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
}
|
||||
|
||||
public SelectionBarsAnnotationRenderable(WPos pos, Actor actor, Rectangle decorationBounds)
|
||||
: this()
|
||||
{
|
||||
this.pos = pos;
|
||||
this.actor = actor;
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct SelectionBoxAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class SelectionBoxAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly WPos pos;
|
||||
readonly Rectangle decorationBounds;
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct TextAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
public class TextAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly SpriteFont font;
|
||||
readonly WPos pos;
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct UIModelRenderable : IRenderable, IPalettedRenderable
|
||||
public class UIModelRenderable : IRenderable, IPalettedRenderable
|
||||
{
|
||||
readonly IEnumerable<ModelAnimation> models;
|
||||
readonly WPos effectiveWorldPos;
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
return new FinalizedUIModelRenderable(wr, this);
|
||||
}
|
||||
|
||||
struct FinalizedUIModelRenderable : IFinalizedRenderable
|
||||
class FinalizedUIModelRenderable : IFinalizedRenderable
|
||||
{
|
||||
readonly UIModelRenderable model;
|
||||
readonly ModelRenderProxy renderProxy;
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Common.Graphics
|
||||
{
|
||||
public struct UITextRenderable : IRenderable, IFinalizedRenderable
|
||||
public class UITextRenderable : IRenderable, IFinalizedRenderable
|
||||
{
|
||||
readonly SpriteFont font;
|
||||
readonly WPos effectiveWorldPos;
|
||||
|
||||
Reference in New Issue
Block a user