Added a flag ShowShadow in WithVoxelBarrel, WithVoxelBody, WithVoxelTurret, WithVoxelUnloadBody and WithVoxelWalkerBody

This commit is contained in:
abc013
2016-09-20 13:34:05 +02:00
parent c9474a857a
commit b9d1f373fe
7 changed files with 33 additions and 14 deletions

View File

@@ -21,14 +21,16 @@ namespace OpenRA.Graphics
public readonly Func<IEnumerable<WRot>> RotationFunc;
public readonly Func<bool> DisableFunc;
public readonly Func<uint> FrameFunc;
public readonly bool ShowShadow;
public VoxelAnimation(Voxel voxel, Func<WVec> offset, Func<IEnumerable<WRot>> rotation, Func<bool> disable, Func<uint> frame)
public VoxelAnimation(Voxel voxel, Func<WVec> offset, Func<IEnumerable<WRot>> rotation, Func<bool> disable, Func<uint> frame, bool showshadow)
{
Voxel = voxel;
OffsetFunc = offset;
RotationFunc = rotation;
DisableFunc = disable;
FrameFunc = frame;
ShowShadow = showshadow;
}
}
}

View File

@@ -212,8 +212,9 @@ namespace OpenRA.Graphics
lightAmbientColor, lightDiffuseColor, color.TextureMidIndex, normals.TextureMidIndex);
// Disable shadow normals by forcing zero diffuse and identity ambient light
Render(rd, Util.MatrixMultiply(shadow, t), lightDirection,
ShadowAmbient, ShadowDiffuse, shadowPalette.TextureMidIndex, normals.TextureMidIndex);
if (v.ShowShadow)
Render(rd, Util.MatrixMultiply(shadow, t), lightDirection,
ShadowAmbient, ShadowDiffuse, shadowPalette.TextureMidIndex, normals.TextureMidIndex);
}
}
}));