public void AllocateHardwareAnimationElements( ushort count )
{
// Find first free texture coord set
short texCoord = 0;
for ( int i = 0; i < vertexDeclaration.ElementCount; i++ )
{
VertexElement element = vertexDeclaration.GetElement( i );
if ( element.Semantic == VertexElementSemantic.TexCoords )
++texCoord;
}
Debug.Assert( texCoord <= Config.MaxTextureCoordSets );
// Increase to correct size
for ( int c = HWAnimationDataList.Count; c < count; ++c )
{
// Create a new 3D texture coordinate set
HardwareAnimationData data = new HardwareAnimationData();
data.TargetVertexElement = vertexDeclaration.AddElement( vertexBufferBinding.NextIndex, 0, VertexElementType.Float3, VertexElementSemantic.TexCoords, texCoord++ );
HWAnimationDataList.Add( data );
// Vertex buffer will not be bound yet, we expect this to be done by the
// caller when it becomes appropriate (e.g. through a VertexAnimationTrack)
}
}