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 /source/blender/editors
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 'source/blender/editors')
-rw-r--r--source/blender/editors/util/navmesh_conversion.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/util/navmesh_conversion.cpp b/source/blender/editors/util/navmesh_conversion.cpp
index 2068d17435c..255e3387ab2 100644
--- a/source/blender/editors/util/navmesh_conversion.cpp
+++ b/source/blender/editors/util/navmesh_conversion.cpp
@@ -146,7 +146,6 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
const float* verts, const unsigned short* dtris,
const int* dtrisToPolysMap)
{
- bool res = false;
int capacity = vertsPerPoly;
unsigned short* newPoly = new unsigned short[capacity];
memset(newPoly, 0xff, sizeof(unsigned short)*capacity);
@@ -268,7 +267,6 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
}
}
}
- res = true;
returnLabel:
delete newPoly;
@@ -280,8 +278,13 @@ struct SortContext
const int* recastData;
const int* trisToFacesMap;
};
-static int compareByData(void* data, const void * a, const void * b){
- SortContext* context = (SortContext*)data;
+#if defined(_MSC_VER)
+static int compareByData(const void* data, void * a, void * b)
+#else
+static int compareByData(const void * a, const void * b, void* data)
+#endif
+{
+ const SortContext* context = (const SortContext*)data;
return ( context->recastData[context->trisToFacesMap[*(int*)a]] -
context->recastData[context->trisToFacesMap[*(int*)b]] );
}
@@ -307,8 +310,11 @@ bool buildNavMeshData(const int nverts, const float* verts,
SortContext context;
context.recastData = recastData;
context.trisToFacesMap = trisToFacesMap;
+#if defined(_MSC_VER)
qsort_s(trisMapping, ntris, sizeof(int), compareByData, &context);
-
+#else
+ qsort_r(trisMapping, ntris, sizeof(int), compareByData, &context);
+#endif
//search first valid triangle - triangle of convex polygon
int validTriStart = -1;
for (int i=0; i< ntris; i++)