But now it seems that its memcpy hogging the cpu, and Im hardly getting a noticeable fps boost from this when the camera is static (which is when I use stored vertex arrays instead of making new ones)

Moderator: Moderators
Code: Select all
inline void CVertexArray::clone(CVertexArray * from){
delete drawArray;
delete stripArray;
drawArray= new float[(from->drawArraySize - from->drawArray)];
memcpy( drawArray,from->drawArray,(from->drawArrayPos+1 - from->drawArray)*sizeof(float));
drawArraySize=drawArray +(from->drawArraySize - from->drawArray);
drawArrayPos=drawArray +(from->drawArrayPos - from->drawArray);
stripArray= new unsigned int[(from->stripArraySize - from->stripArray)];
memcpy(stripArray,from->stripArray,(from->stripArrayPos+1 - from->stripArray)*sizeof(unsigned int));
stripArraySize=stripArray +(from->stripArraySize - from->stripArray);
stripArrayPos=stripArray +(from->stripArrayPos - from->stripArray);
maxVertices=from->maxVertices;
}