protected virtual void ReadSubMeshNameTable( BinaryReader reader )
{
if ( !IsEOF( reader ) )
{
MeshChunkID chunkID = ReadChunk( reader );
while ( !IsEOF( reader ) && ( chunkID == MeshChunkID.SubMeshNameTableElement ) )
{
// i'm not bothering with the name table business here, I don't see what the purpose is
// since we can simply name the submesh. it appears this section always comes after all submeshes
// are read, so it should be safe
short index = ReadShort( reader );
string name = ReadString( reader );
SubMesh sub = mesh.GetSubMesh( index );
if ( sub != null )
{
sub.Name = name;
}
// If we're not end of file get the next chunk ID
if ( !IsEOF( reader ) )
{
chunkID = ReadChunk( reader );
}
}
// backpedal to the start of the chunk
if ( !IsEOF( reader ) )
{
Seek( reader, -ChunkOverheadSize );
}
}
}