Update float3 to readonly and use in modifier for parameters.

This commit is contained in:
teinarss
2020-12-02 19:30:54 +01:00
committed by abcdefg30
parent d3847d49ed
commit 2c9a36b9a3
15 changed files with 51 additions and 51 deletions

View File

@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Graphics
IEnumerable<ModelAnimation> models, WPos pos, int zOffset, in WRot camera, float scale,
in WRot lightSource, float[] lightAmbientColor, float[] lightDiffuseColor,
PaletteReference color, PaletteReference normals, PaletteReference shadow,
float3 tint)
in float3 tint)
{
this.models = models;
this.pos = pos;
@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Graphics
public IRenderable AsDecoration() { return this; }
public IRenderable WithTint(float3 newTint)
public IRenderable WithTint(in float3 newTint)
{
return new ModelRenderable(
models, pos, zOffset, camera, scale,
@@ -195,7 +195,7 @@ namespace OpenRA.Mods.Common.Graphics
static readonly uint[] CornerXIndex = new uint[] { 0, 0, 0, 0, 3, 3, 3, 3 };
static readonly uint[] CornerYIndex = new uint[] { 1, 1, 4, 4, 1, 1, 4, 4 };
static readonly uint[] CornerZIndex = new uint[] { 2, 5, 2, 5, 2, 5, 2, 5 };
static void DrawBoundsBox(WorldRenderer wr, float3 pxPos, float[] transform, float[] bounds, float width, Color c)
static void DrawBoundsBox(WorldRenderer wr, in float3 pxPos, float[] transform, float[] bounds, float width, Color c)
{
var cr = Game.Renderer.RgbaColorRenderer;
var corners = new float2[8];

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly float Intensity;
public readonly float3 Tint;
public LightSource(WPos pos, CPos cell, WDist range, float intensity, float3 tint)
public LightSource(WPos pos, CPos cell, WDist range, float intensity, in float3 tint)
{
Pos = pos;
Cell = cell;
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.Common.Traits
return new Rectangle(c.X - r, c.Y - r, 2 * r, 2 * r);
}
public int AddLightSource(WPos pos, WDist range, float intensity, float3 tint)
public int AddLightSource(WPos pos, WDist range, float intensity, in float3 tint)
{
var token = nextLightSourceToken++;
var source = new LightSource(pos, map.CellContaining(pos), range, intensity, tint);

View File

@@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly float3 ScreenPosition;
public readonly byte Variant;
public TileInfo(float3 screenPosition, byte variant)
public TileInfo(in float3 screenPosition, byte variant)
{
ScreenPosition = screenPosition;
Variant = variant;