diff options
Diffstat (limited to 'extern/recastnavigation/Recast')
3 files changed, 23 insertions, 23 deletions
diff --git a/extern/recastnavigation/Recast/Source/RecastContour.cpp b/extern/recastnavigation/Recast/Source/RecastContour.cpp index 078c464e5f4..df943838ffb 100644 --- a/extern/recastnavigation/Recast/Source/RecastContour.cpp +++ b/extern/recastnavigation/Recast/Source/RecastContour.cpp @@ -321,7 +321,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, // Find maximum deviation from the segment. float maxd = 0; - int maxi = -1; + int i_max = -1; int ci, cinc, endi; // Traverse the segment in lexilogical order so that the @@ -350,7 +350,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, if (d > maxd) { maxd = d; - maxi = ci; + i_max = ci; } ci = (ci+cinc) % pn; } @@ -359,7 +359,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, // If the max deviation is larger than accepted error, // add new point, else continue to next segment. - if (maxi != -1 && maxd > (maxError*maxError)) + if (i_max != -1 && maxd > (maxError*maxError)) { // Add space for the new point. simplified.resize(simplified.size()+4); @@ -372,10 +372,10 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, simplified[j*4+3] = simplified[(j-1)*4+3]; } // Add the point. - simplified[(i+1)*4+0] = points[maxi*4+0]; - simplified[(i+1)*4+1] = points[maxi*4+1]; - simplified[(i+1)*4+2] = points[maxi*4+2]; - simplified[(i+1)*4+3] = maxi; + simplified[(i+1)*4+0] = points[i_max*4+0]; + simplified[(i+1)*4+1] = points[i_max*4+1]; + simplified[(i+1)*4+2] = points[i_max*4+2]; + simplified[(i+1)*4+3] = i_max; } else { @@ -399,7 +399,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, const int bi = simplified[ii*4+3]; // Find maximum deviation from the segment. - int maxi = -1; + int i_max = -1; int ci = (ai+1) % pn; // Tessellate only outer edges or edges between areas. @@ -423,19 +423,19 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, if (bx > ax || (bx == ax && bz > az)) { const int n = bi < ai ? (bi+pn - ai) : (bi - ai); - maxi = (ai + n/2) % pn; + i_max = (ai + n/2) % pn; } else { const int n = bi < ai ? (bi+pn - ai) : (bi - ai); - maxi = (ai + (n+1)/2) % pn; + i_max = (ai + (n+1)/2) % pn; } } } // If the max deviation is larger than accepted error, // add new point, else continue to next segment. - if (maxi != -1) + if (i_max != -1) { // Add space for the new point. simplified.resize(simplified.size()+4); @@ -448,10 +448,10 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, simplified[j*4+3] = simplified[(j-1)*4+3]; } // Add the point. - simplified[(i+1)*4+0] = points[maxi*4+0]; - simplified[(i+1)*4+1] = points[maxi*4+1]; - simplified[(i+1)*4+2] = points[maxi*4+2]; - simplified[(i+1)*4+3] = maxi; + simplified[(i+1)*4+0] = points[i_max*4+0]; + simplified[(i+1)*4+1] = points[i_max*4+1]; + simplified[(i+1)*4+2] = points[i_max*4+2]; + simplified[(i+1)*4+3] = i_max; } else { diff --git a/extern/recastnavigation/Recast/Source/RecastMesh.cpp b/extern/recastnavigation/Recast/Source/RecastMesh.cpp index ef37d569a17..e6d89eed3a8 100644 --- a/extern/recastnavigation/Recast/Source/RecastMesh.cpp +++ b/extern/recastnavigation/Recast/Source/RecastMesh.cpp @@ -305,7 +305,7 @@ static int triangulate(int n, const int* verts, int* indices, int* tris) while (n > 3) { int minLen = -1; - int mini = -1; + int i_min = -1; for (int i = 0; i < n; i++) { int i1 = next(i, n); @@ -321,12 +321,12 @@ static int triangulate(int n, const int* verts, int* indices, int* tris) if (minLen < 0 || len < minLen) { minLen = len; - mini = i; + i_min = i; } } } - if (mini == -1) + if (i_min == -1) { // Should not happen. /* printf("mini == -1 ntris=%d n=%d\n", ntris, n); @@ -338,7 +338,7 @@ static int triangulate(int n, const int* verts, int* indices, int* tris) return -ntris; } - int i = mini; + int i = i_min; int i1 = next(i, n); int i2 = next(i1, n); diff --git a/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp b/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp index 3922c864eba..130c08ec369 100644 --- a/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp +++ b/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp @@ -579,23 +579,23 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin, const float* vb = &edge[b*3]; // Find maximum deviation along the segment. float maxd = 0; - int maxi = -1; + int i_max = -1; for (int m = a+1; m < b; ++m) { float d = distancePtSeg(&edge[m*3],va,vb); if (d > maxd) { maxd = d; - maxi = m; + i_max = m; } } // If the max deviation is larger than accepted error, // add new point, else continue to next segment. - if (maxi != -1 && maxd > rcSqr(sampleMaxError)) + if (i_max != -1 && maxd > rcSqr(sampleMaxError)) { for (int m = nidx; m > k; --m) idx[m] = idx[m-1]; - idx[k+1] = maxi; + idx[k+1] = i_max; nidx++; } else |