Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-10 07:07:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-10 07:07:26 +0400
commit0128218254df07f804b15088036a1e7ef4938664 (patch)
tree7413c64bd110b4c4a171e2f9f3c725c3dfb314d5 /extern/recastnavigation/Recast/Source/RecastMesh.cpp
parent23b843130b5aa77988ac158bb11addcccec01e68 (diff)
recast and detour patch now builds again with GCC
- rearrange structs to work for 64bit - define all vars before goto's - ifdefs for qsort_r/qsort_s - dont cast pointers to int only for NULL checks - dont printf STR_String directly, get the char pointer from it also minor change to gpu py module, no need to pass empty tuple to PyObject_CallObject, can just be NULL
Diffstat (limited to 'extern/recastnavigation/Recast/Source/RecastMesh.cpp')
-rw-r--r--extern/recastnavigation/Recast/Source/RecastMesh.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/extern/recastnavigation/Recast/Source/RecastMesh.cpp b/extern/recastnavigation/Recast/Source/RecastMesh.cpp
index 45ed4a2fdc6..38d62904213 100644
--- a/extern/recastnavigation/Recast/Source/RecastMesh.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastMesh.cpp
@@ -489,6 +489,9 @@ static void pushBack(int v, int* arr, int& an)
static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int maxTris)
{
+ unsigned short* tmpPoly;
+ int ntris;
+
static const int nvp = mesh.nvp;
int* edges = 0;
@@ -671,7 +674,7 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
}
// Triangulate the hole.
- int ntris = triangulate(nhole, &tverts[0], &thole[0], tris);
+ ntris = triangulate(nhole, &tverts[0], &thole[0], tris);
// Merge the hole triangles back to polygons.
polys = new unsigned short[(ntris+1)*nvp];
@@ -689,7 +692,7 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
goto failure;
}
- unsigned short* tmpPoly = &polys[ntris*nvp];
+ tmpPoly = &polys[ntris*nvp];
// Build initial polygons.
memset(polys, 0xff, ntris*nvp*sizeof(unsigned short));
@@ -793,7 +796,9 @@ failure:
bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
{
+ unsigned short* tmpPoly;
rcTimeVal startTime = rcGetPerformanceTimer();
+ rcTimeVal endTime;
vcopy(mesh.bmin, cset.bmin);
vcopy(mesh.bmax, cset.bmax);
@@ -902,7 +907,7 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'polys' (%d).", maxVertsPerCont*nvp);
goto failure;
}
- unsigned short* tmpPoly = &polys[maxVertsPerCont*nvp];
+ tmpPoly = &polys[maxVertsPerCont*nvp];
for (int i = 0; i < cset.nconts; ++i)
{
@@ -1050,7 +1055,7 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
return false;
}
- rcTimeVal endTime = rcGetPerformanceTimer();
+ endTime = rcGetPerformanceTimer();
// if (rcGetLog())
// rcGetLog()->log(RC_LOG_PROGRESS, "Build polymesh: %.3f ms", rcGetDeltaTimeUsec(startTime, endTime)/1000.0f);
@@ -1076,6 +1081,7 @@ bool rcMergePolyMeshes(rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
return true;
rcTimeVal startTime = rcGetPerformanceTimer();
+ rcTimeVal endTime;
int* nextVert = 0;
int* firstVert = 0;
@@ -1196,7 +1202,7 @@ bool rcMergePolyMeshes(rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
delete [] nextVert;
delete [] vremap;
- rcTimeVal endTime = rcGetPerformanceTimer();
+ endTime = rcGetPerformanceTimer();
if (rcGetBuildTimes())
rcGetBuildTimes()->mergePolyMesh += rcGetDeltaTimeUsec(startTime, endTime);