Its late and i need some help
Anyone know why this code is giving an illegal opperation?
It compiles but when i try to the program it crashes.
//Loop through each point of a triangle
for (int k = 0; k < 3; k++)
{
//Start at the top of the vertex list
VertexList * pVertCurrent = pCollisionGroupsCurrent->pVertFirst;
int l = 0;
while(1)
{
if (pVertCurrent->m_location == m_pVertices[m_pTriangles[pTriangleIndices[j]].m_vertexIndices[k]].m_location)
{
break;
}
//End of the lsit
if (pVertCurrent == NULL)
{
pVertCurrent = new(VertexList);
pVertCurrent->m_location[0] = m_pVertices[m_pTriangles[pTriangleIndices[j]].m_vertexIndices[k]].m_location[0];
pVertCurrent->m_location[1] = m_pVertices[m_pTriangles[pTriangleIndices[j]].m_vertexIndices[k]].m_location[1];
pVertCurrent->m_location[2] = m_pVertices[m_pTriangles[pTriangleIndices[j]].m_vertexIndices[k]].m_location[2];
break;
}
********** //compiler says there is someting wrong here
//something about an access violation
pVertCurrent = pVertCurrent->pNext;
l++;
}
Sorry bout the mess. Help much appreciated.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement