diff options
Diffstat (limited to 'dep/recastnavigation/Recast/Recast.cpp')
-rw-r--r-- | dep/recastnavigation/Recast/Recast.cpp | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/dep/recastnavigation/Recast/Recast.cpp b/dep/recastnavigation/Recast/Recast.cpp index 803daac3bcf..922c9163c13 100644 --- a/dep/recastnavigation/Recast/Recast.cpp +++ b/dep/recastnavigation/Recast/Recast.cpp @@ -109,28 +109,6 @@ void rcFreeCompactHeightfield(rcCompactHeightfield* chf) rcFree(chf); } - -rcHeightfieldLayerSet* rcAllocHeightfieldLayerSet() -{ - rcHeightfieldLayerSet* lset = (rcHeightfieldLayerSet*)rcAlloc(sizeof(rcHeightfieldLayerSet), RC_ALLOC_PERM); - memset(lset, 0, sizeof(rcHeightfieldLayerSet)); - return lset; -} - -void rcFreeHeightfieldLayerSet(rcHeightfieldLayerSet* lset) -{ - if (!lset) return; - for (int i = 0; i < lset->nlayers; ++i) - { - rcFree(lset->layers[i].heights); - rcFree(lset->layers[i].areas); - rcFree(lset->layers[i].cons); - } - rcFree(lset->layers); - rcFree(lset); -} - - rcContourSet* rcAllocContourSet() { rcContourSet* cset = (rcContourSet*)rcAlloc(sizeof(rcContourSet), RC_ALLOC_PERM); @@ -439,13 +417,13 @@ bool rcBuildCompactHeightfield(rcContext* ctx, const int walkableHeight, const i if ((top - bot) >= walkableHeight && rcAbs((int)ns.y - (int)s.y) <= walkableClimb) { // Mark direction as walkable. - const int lidx = k - (int)nc.index; - if (lidx < 0 || lidx > MAX_LAYERS) + const int idx = k - (int)nc.index; + if (idx < 0 || idx > MAX_LAYERS) { - tooHighNeighbour = rcMax(tooHighNeighbour, lidx); + tooHighNeighbour = rcMax(tooHighNeighbour, idx); continue; } - rcSetCon(s, dir, lidx); + rcSetCon(s, dir, idx); break; } } |