mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: light cleanup
This commit is contained in:
parent
ba23bfa471
commit
06ba52d4e6
@ -399,7 +399,7 @@ static void simplifyContour(rdIntArray& points, rdIntArray& simplified,
|
||||
if (dx*dx + dy*dy > maxEdgeLen*maxEdgeLen)
|
||||
{
|
||||
// Round based on the segments in lexilogical order so that the
|
||||
// max tesselation is consistent regardles in which direction
|
||||
// max tessellation is consistent regardless in which direction
|
||||
// segments are traversed.
|
||||
const int n = bi < ai ? (bi+pn - ai) : (bi - ai);
|
||||
if (n > 1)
|
||||
|
@ -163,7 +163,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
const unsigned char nr = srcReg[ai];
|
||||
if (nr != 0xff)
|
||||
{
|
||||
// Set neighbour when first valid neighbour is encoutered.
|
||||
// Set neighbour when first valid neighbour is encountered.
|
||||
if (sweeps[sid].ns == 0)
|
||||
sweeps[sid].nei = nr;
|
||||
|
||||
@ -175,7 +175,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is hit if there is nore than one neighbour.
|
||||
// This is hit if there is more than one neighbour.
|
||||
// Invalidate the neighbour.
|
||||
sweeps[sid].nei = 0xff;
|
||||
}
|
||||
|
@ -509,6 +509,7 @@ inline bool uright(const unsigned short* a, const unsigned short* b, const unsig
|
||||
return ((int)b[0] - (int)a[0]) * ((int)c[1] - (int)a[1]) -
|
||||
((int)c[0] - (int)a[0]) * ((int)b[1] - (int)a[1]) > 0;
|
||||
}
|
||||
|
||||
static int getPolyMergeValue(unsigned short* pa, unsigned short* pb,
|
||||
const unsigned short* verts, int& ea, int& eb,
|
||||
const int nvp)
|
||||
@ -559,7 +560,7 @@ static int getPolyMergeValue(unsigned short* pa, unsigned short* pb,
|
||||
if (!uright(&verts[va*3], &verts[vb*3], &verts[vc*3]))
|
||||
return -1;
|
||||
#else
|
||||
if (!uleft(&verts[va * 3], &verts[vb * 3], &verts[vc * 3]))
|
||||
if (!uleft(&verts[va*3], &verts[vb*3], &verts[vc*3]))
|
||||
return -1;
|
||||
#endif
|
||||
va = pb[(eb+nb-1) % nb];
|
||||
@ -1359,7 +1360,7 @@ bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMe
|
||||
}
|
||||
}
|
||||
|
||||
// Just allocate the mesh flags array. The user is resposible to fill it.
|
||||
// Just allocate the mesh flags array. The user is responsible to fill it.
|
||||
mesh.flags = (unsigned short*)rdAlloc(sizeof(unsigned short)*mesh.npolys, RD_ALLOC_PERM);
|
||||
if (!mesh.flags)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user