Lines Matching refs:mesh
33 HeaderStruct_Fixed_Mesh *CreateFixedObjectMesh(HeaderStruct_Mesh *mesh) in CreateFixedObjectMesh() argument
37 new_mesh->fCenter[0] = PVRTF2X(mesh->fCenter[0]); in CreateFixedObjectMesh()
38 new_mesh->fCenter[1] = PVRTF2X(mesh->fCenter[1]); in CreateFixedObjectMesh()
39 new_mesh->fCenter[2] = PVRTF2X(mesh->fCenter[2]); in CreateFixedObjectMesh()
42 new_mesh->nNumVertex = mesh->nNumVertex; in CreateFixedObjectMesh()
43 new_mesh->nNumFaces = mesh->nNumFaces; in CreateFixedObjectMesh()
44 new_mesh->nNumStrips = mesh->nNumStrips; in CreateFixedObjectMesh()
45 new_mesh->nMaterial = mesh->nMaterial; in CreateFixedObjectMesh()
47 if(mesh->nNumVertex) in CreateFixedObjectMesh()
49 new_mesh->pVertex = new VERTTYPE[mesh->nNumVertex*3]; in CreateFixedObjectMesh()
50 for(unsigned int i = 0; i < mesh->nNumVertex*3; i++) // each vertex is 3 floats in CreateFixedObjectMesh()
51 new_mesh->pVertex[i] = PVRTF2X(mesh->pVertex[i]); in CreateFixedObjectMesh()
59 if(mesh->pUV) in CreateFixedObjectMesh()
61 new_mesh->pUV = new VERTTYPE[mesh->nNumVertex*2]; in CreateFixedObjectMesh()
62 for(unsigned int i = 0; i < mesh->nNumVertex*2; i++) // UVs come in pairs of floats in CreateFixedObjectMesh()
63 new_mesh->pUV[i] = PVRTF2X(mesh->pUV[i]); in CreateFixedObjectMesh()
68 if(mesh->pNormals) in CreateFixedObjectMesh()
70 new_mesh->pNormals = new VERTTYPE[mesh->nNumVertex*3]; in CreateFixedObjectMesh()
71 for(unsigned int i = 0; i < mesh->nNumVertex*3; i++) // each normal is 3 floats in CreateFixedObjectMesh()
72 new_mesh->pNormals[i] = PVRTF2X(mesh->pNormals[i]); in CreateFixedObjectMesh()
90 if(mesh->pPackedVertex) in CreateFixedObjectMesh()
92 unsigned int nPackedVertSize = mesh->nNumVertex * 3 + in CreateFixedObjectMesh()
93 (mesh->nFlags & MF_NORMALS ? mesh->nNumVertex * 3 : 0) + in CreateFixedObjectMesh()
94 (mesh->nFlags & MF_VERTEXCOLOR ? mesh->nNumVertex * 3 : 0) + in CreateFixedObjectMesh()
95 (mesh->nFlags & MF_UV ? mesh->nNumVertex * 2 : 0); in CreateFixedObjectMesh()
99 new_mesh->pPackedVertex[i] = PVRTF2X(mesh->pPackedVertex[i]); in CreateFixedObjectMesh()
106 new_mesh->pVertexColor = mesh->pVertexColor; in CreateFixedObjectMesh()
107 new_mesh->pVertexMaterial = mesh->pVertexMaterial; in CreateFixedObjectMesh()
108 new_mesh->pFaces = mesh->pFaces; in CreateFixedObjectMesh()
109 new_mesh->pStrips = mesh->pStrips; in CreateFixedObjectMesh()
110 new_mesh->pStripLength = mesh->pStripLength; in CreateFixedObjectMesh()
114 new_mesh->Patch.nType = mesh->Patch.nType; in CreateFixedObjectMesh()
115 new_mesh->Patch.nNumPatches = mesh->Patch.nNumPatches; in CreateFixedObjectMesh()
116 new_mesh->Patch.nNumVertices = mesh->Patch.nNumVertices; in CreateFixedObjectMesh()
117 new_mesh->Patch.nNumSubdivisions = mesh->Patch.nNumSubdivisions; in CreateFixedObjectMesh()
118 new_mesh->Patch.pControlPoints = mesh->Patch.pControlPoints; in CreateFixedObjectMesh()
119 new_mesh->Patch.pUVs = mesh->Patch.pUVs; in CreateFixedObjectMesh()
129 void FreeFixedObjectMesh(HeaderStruct_Fixed_Mesh* mesh) in FreeFixedObjectMesh() argument
132 delete[] mesh->pVertex; in FreeFixedObjectMesh()
133 delete[] mesh->pUV; in FreeFixedObjectMesh()
134 delete[] mesh->pNormals; in FreeFixedObjectMesh()
135 delete[] mesh->pPackedVertex; in FreeFixedObjectMesh()
137 delete mesh; in FreeFixedObjectMesh()