| 767 | } |
| 768 | |
| 769 | void TSShape::initVertexFeatures() |
| 770 | { |
| 771 | |
| 772 | if (!needsBufferUpdate()) |
| 773 | { |
| 774 | // Init format from basic format |
| 775 | mVertexFormat.clear(); |
| 776 | mBasicVertexFormat.getFormat(mVertexFormat); |
| 777 | mVertexSize = mVertexFormat.getSizeInBytes(); |
| 778 | |
| 779 | initVertexBufferPointers(); |
| 780 | |
| 781 | for (Vector<TSMesh*>::iterator iter = meshes.begin(); iter != meshes.end(); iter++) |
| 782 | { |
| 783 | TSMesh *mesh = *iter; |
| 784 | if (mesh && |
| 785 | (mesh->getMeshType() == TSMesh::SkinMeshType)) |
| 786 | { |
| 787 | static_cast<TSSkinMesh*>(mesh)->createSkinBatchData(); |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | // Make sure VBO is init'd |
| 792 | initVertexBuffers(); |
| 793 | return; |
| 794 | } |
| 795 | |
| 796 | // Cleanout VBO |
| 797 | mShapeVertexBuffer = NULL; |
| 798 | |
| 799 | // Make sure mesh has verts stored in mesh data, we're recreating the buffer |
| 800 | TSBasicVertexFormat basicFormat; |
| 801 | |
| 802 | initVertexBufferPointers(); |
| 803 | |
| 804 | for (Vector<TSMesh*>::iterator iter = meshes.begin(); iter != meshes.end(); iter++) |
| 805 | { |
| 806 | TSMesh *mesh = *iter; |
| 807 | if (mesh && |
| 808 | (mesh->getMeshType() == TSMesh::StandardMeshType || |
| 809 | mesh->getMeshType() == TSMesh::SkinMeshType)) |
| 810 | { |
| 811 | // Make sure we have everything in the vert lists |
| 812 | mesh->makeEditable(); |
| 813 | |
| 814 | // We need the skin batching data here to determine bone counts |
| 815 | if (mesh->getMeshType() == TSMesh::SkinMeshType) |
| 816 | { |
| 817 | static_cast<TSSkinMesh*>(mesh)->createSkinBatchData(); |
| 818 | } |
| 819 | |
| 820 | basicFormat.addMeshRequirements(mesh); |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | mVertexFormat.clear(); |
| 825 | mBasicVertexFormat = basicFormat; |
| 826 | mBasicVertexFormat.getFormat(mVertexFormat); |
nothing calls this directly
no test coverage detected