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