fix for issues 48 and 49.

This commit is contained in:
Mikko Mononen 2010-02-20 17:53:04 +00:00
parent e51b31dab4
commit dbf95000e6
2 changed files with 4 additions and 3 deletions

View File

@ -448,7 +448,7 @@ void rcRasterizeTriangle(const float* v0, const float* v1, const float* v2,
unsigned char flags, rcHeightfield& solid, unsigned char flags, rcHeightfield& solid,
const int flagMergeThr = 1); const int flagMergeThr = 1);
// Rasterizes the triangles into heightfield spans. // Rasterizes indexed triangle mesh into heightfield spans.
// Params: // Params:
// verts - (in) array of vertices // verts - (in) array of vertices
// nv - (in) vertex count // nv - (in) vertex count
@ -461,7 +461,7 @@ void rcRasterizeTriangles(const float* verts, int nv,
const int* tris, const unsigned char* flags, int nt, const int* tris, const unsigned char* flags, int nt,
rcHeightfield& solid, const int flagMergeThr = 1); rcHeightfield& solid, const int flagMergeThr = 1);
// Rasterizes the triangles into heightfield spans. // Rasterizes indexed triangle mesh into heightfield spans.
// Params: // Params:
// verts - (in) array of vertices // verts - (in) array of vertices
// nv - (in) vertex count // nv - (in) vertex count
@ -481,7 +481,7 @@ void rcRasterizeTriangles(const float* verts, int nv,
// nt - (in) triangle count // nt - (in) triangle count
// solid - (in) heighfield where the triangles are rasterized // solid - (in) heighfield where the triangles are rasterized
void rcRasterizeTriangles(const float* verts, const unsigned char* flags, int nt, void rcRasterizeTriangles(const float* verts, const unsigned char* flags, int nt,
rcHeightfield& solid); rcHeightfield& solid, const int flagMergeThr = 1);
// Marks non-walkable low obstacles as walkable if they are closer than walkableClimb // Marks non-walkable low obstacles as walkable if they are closer than walkableClimb
// from a walkable surface. Applying this filter allows to step over low hanging // from a walkable surface. Applying this filter allows to step over low hanging

View File

@ -1075,6 +1075,7 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.flags' (%d).", mesh.npolys); rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.flags' (%d).", mesh.npolys);
return false; return false;
} }
memset(mesh.flags, 0, sizeof(unsigned short) * mesh.npolys);
rcTimeVal endTime = rcGetPerformanceTimer(); rcTimeVal endTime = rcGetPerformanceTimer();