diff --git a/OpenRA.Mods.TS/Traits/Render/RenderVoxels.cs b/OpenRA.Mods.TS/Traits/Render/RenderVoxels.cs index 3e7593c9d0..62fec30977 100644 --- a/OpenRA.Mods.TS/Traits/Render/RenderVoxels.cs +++ b/OpenRA.Mods.TS/Traits/Render/RenderVoxels.cs @@ -36,8 +36,8 @@ namespace OpenRA.Mods.TS.Traits public readonly WAngle LightPitch = WAngle.FromDegrees(50); public readonly WAngle LightYaw = WAngle.FromDegrees(240); - public readonly float[] LightAmbientColor = new float[] {0.6f, 0.6f, 0.6f}; - public readonly float[] LightDiffuseColor = new float[] {0.4f, 0.4f, 0.4f}; + public readonly float[] LightAmbientColor = new float[] { 0.6f, 0.6f, 0.6f }; + public readonly float[] LightDiffuseColor = new float[] { 0.4f, 0.4f, 0.4f }; public virtual object Create(ActorInitializer init) { return new RenderVoxels(init.self, this); } @@ -59,7 +59,6 @@ namespace OpenRA.Mods.TS.Traits this.LightYaw, this.LightAmbientColor, this.LightDiffuseColor, body.CameraPitch, palette, init.WorldRenderer.Palette(NormalsPalette), init.WorldRenderer.Palette("shadow")); } - } public class RenderVoxels : IRender, INotifyOwnerChanged @@ -77,7 +76,7 @@ namespace OpenRA.Mods.TS.Traits this.info = info; body = self.Trait(); camera = new WRot(WAngle.Zero, body.CameraPitch - new WAngle(256), new WAngle(256)); - lightSource = new WRot(WAngle.Zero,new WAngle(256) - info.LightPitch, info.LightYaw); + lightSource = new WRot(WAngle.Zero, new WAngle(256) - info.LightPitch, info.LightYaw); } bool initializePalettes = true; diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs index 3389381e23..91eff71783 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.TS.Traits var turretOrientation = body.QuantizeOrientation(new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(t.InitialFacing) - orientation.Yaw), facings); var turretOffset = body.LocalToWorld(t.Offset.Rotate(orientation)); - yield return new VoxelAnimation(voxel, () => turretOffset, () => new [] { turretOrientation, orientation }, + yield return new VoxelAnimation(voxel, () => turretOffset, () => new[] { turretOrientation, orientation }, () => false, () => 0); } } @@ -76,7 +76,7 @@ namespace OpenRA.Mods.TS.Traits var turretOrientation = turreted != null ? turreted.LocalOrientation(self) : WRot.Zero; var quantizedBody = body.QuantizeOrientation(self, self.Orientation); - var quantizedTurret = body.QuantizeOrientation(self, turretOrientation); + var quantizedTurret = body.QuantizeOrientation(self, turretOrientation); return turretOffset + body.LocalToWorld(localOffset.Rotate(quantizedTurret).Rotate(quantizedBody)); } diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelBody.cs index 5f62a7bfed..d80b1e4307 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelBody.cs @@ -48,12 +48,12 @@ namespace OpenRA.Mods.TS.Traits var voxel = VoxelProvider.GetVoxel(rv.Image, info.Sequence); rv.Add(new VoxelAnimation(voxel, () => WVec.Zero, - () => new[]{ body.QuantizeOrientation(self, self.Orientation) }, + () => new[] { body.QuantizeOrientation(self, self.Orientation) }, () => false, () => 0)); // Selection size var rvi = self.Info.Traits.Get(); - var s = (int)(rvi.Scale*voxel.Size.Aggregate(Math.Max)); + var s = (int)(rvi.Scale * voxel.Size.Aggregate(Math.Max)); size = new int2(s, s); } diff --git a/OpenRA.Mods.TS/Traits/World/VoxelNormalsPalette.cs b/OpenRA.Mods.TS/Traits/World/VoxelNormalsPalette.cs index 0a9ab5a833..26403440dd 100644 --- a/OpenRA.Mods.TS/Traits/World/VoxelNormalsPalette.cs +++ b/OpenRA.Mods.TS/Traits/World/VoxelNormalsPalette.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.TS.Traits { // Rotate vectors to expected orientation // Voxel coordinates are x=forward, y=right, z=up - var channel = new int[] {2,1,0}; + var channel = new int[] { 2, 1, 0 }; var n = info.Type == NormalType.RedAlert2 ? RA2Normals : TSNormals; // Map normals into color range @@ -48,8 +48,8 @@ namespace OpenRA.Mods.TS.Traits data[i] = 0xFF000000; for (var j = 0; j < 3; j++) { - var t = (n[3*i + j] + 1) / 2; - data[i] |= (uint)((byte)(t*0xFF + 0.5) << (8*channel[j])); + var t = (n[3 * i + j] + 1) / 2; + data[i] |= (uint)((byte)(t * 0xFF + 0.5) << (8 * channel[j])); } }