| 735 | } |
| 736 | |
| 737 | void TSShape::initVertexBufferPointers() |
| 738 | { |
| 739 | if (mBasicVertexFormat.vertexSize == -1) |
| 740 | return; |
| 741 | AssertFatal(mVertexSize == mBasicVertexFormat.vertexSize, "vertex size mismatch"); |
| 742 | |
| 743 | for (Vector<TSMesh*>::iterator iter = meshes.begin(); iter != meshes.end(); iter++) |
| 744 | { |
| 745 | TSMesh *mesh = *iter; |
| 746 | if (mesh && |
| 747 | (mesh->getMeshType() == TSMesh::StandardMeshType || |
| 748 | mesh->getMeshType() == TSMesh::SkinMeshType)) |
| 749 | { |
| 750 | // Set buffer |
| 751 | AssertFatal(mesh->mNumVerts == 0 || mesh->mNumVerts >= mesh->vertsPerFrame, "invalid verts per frame"); |
| 752 | if (mesh->mVertSize > 0 && !mesh->mVertexData.isReady()) |
| 753 | { |
| 754 | U32 boneOffset = 0; |
| 755 | U32 texCoordOffset = 0; |
| 756 | AssertFatal(mesh->mVertSize == mVertexFormat.getSizeInBytes(), "mismatch in format size"); |
| 757 | |
| 758 | if (mBasicVertexFormat.boneOffset >= 0) |
| 759 | { |
| 760 | boneOffset = mBasicVertexFormat.boneOffset; |
| 761 | } |
| 762 | |
| 763 | if (mBasicVertexFormat.texCoordOffset >= 0) |
| 764 | { |
| 765 | texCoordOffset = mBasicVertexFormat.texCoordOffset; |
| 766 | } |
| 767 | |
| 768 | // Initialize the vertex data |
| 769 | mesh->mVertexData.set(mShapeVertexData.base + mesh->mVertOffset, mesh->mVertSize, mesh->mNumVerts, texCoordOffset, boneOffset, false); |
| 770 | mesh->mVertexData.setReady(true); |
| 771 | } |
| 772 | } |
| 773 | } |
| 774 | } |
| 775 | |
| 776 | void TSShape::initVertexFeatures() |
| 777 | { |
nothing calls this directly
no test coverage detected