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:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-09-10 18:12:15 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-09-10 18:12:15 +0400
commitbdd4aa27b0747bf7bc4af7e23a79b3fbdd3ee5b0 (patch)
tree36c6245a6c41ab8201e34056a282fb71b7f9f100
parent322dbc9a0fa7d0e1c82fa2968728cbfc5c536445 (diff)
Another set of fixes for recats: osx uses different order of arguments for sort_r
and it's callback. Also do not use char constants like 'NAVM' which is casting to int. And added defautl section to switch in KX_NavMeshObject::DrawNavMesh.
-rw-r--r--extern/recastnavigation/Detour/Include/DetourStatNavMesh.h2
-rw-r--r--extern/recastnavigation/Detour/Include/DetourTileNavMesh.h2
-rw-r--r--extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp4
-rw-r--r--source/blender/editors/util/navmesh_conversion.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_NavMeshObject.cpp3
5 files changed, 13 insertions, 2 deletions
diff --git a/extern/recastnavigation/Detour/Include/DetourStatNavMesh.h b/extern/recastnavigation/Detour/Include/DetourStatNavMesh.h
index 71ee4cb0b51..5a3e04a2074 100644
--- a/extern/recastnavigation/Detour/Include/DetourStatNavMesh.h
+++ b/extern/recastnavigation/Detour/Include/DetourStatNavMesh.h
@@ -42,7 +42,7 @@ struct dtStatPolyDetail
unsigned short ntris; // Number of triangles.
};
-const int DT_STAT_NAVMESH_MAGIC = 'NAVM';
+const int DT_STAT_NAVMESH_MAGIC = (('N'<<24) | ('A'<<16) | ('V'<<8) | 'M');
const int DT_STAT_NAVMESH_VERSION = 3;
struct dtStatBVNode
diff --git a/extern/recastnavigation/Detour/Include/DetourTileNavMesh.h b/extern/recastnavigation/Detour/Include/DetourTileNavMesh.h
index d615b1748f0..305c61e5eb5 100644
--- a/extern/recastnavigation/Detour/Include/DetourTileNavMesh.h
+++ b/extern/recastnavigation/Detour/Include/DetourTileNavMesh.h
@@ -36,7 +36,7 @@ static const int DT_TILE_VERTS_PER_POLYGON = 6;
static const int DT_MAX_TILES = 1 << DT_TILE_REF_TILE_BITS;
static const int DT_MAX_POLYGONS = 1 << DT_TILE_REF_POLY_BITS;
-static const int DT_TILE_NAVMESH_MAGIC = 'NAVT';
+static const int DT_TILE_NAVMESH_MAGIC = (('N'<<24) | ('A'<<16) | ('V'<<8) | 'M');
static const int DT_TILE_NAVMESH_VERSION = 2;
// Structure holding the navigation polygon data.
diff --git a/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp b/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
index b43346c53e2..8fc3fa833f9 100644
--- a/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
@@ -97,6 +97,8 @@ static int circumCircle(const float xp, const float yp,
#if defined(_MSC_VER)
static int ptcmp(void* up, const void *v1, const void *v2)
+#elif defined(__APPLE__)
+static int ptcmp(void* up, const void *v1, const void *v2)
#else
static int ptcmp(const void *v1, const void *v2, void* up)
#endif
@@ -122,6 +124,8 @@ static void delaunay(const int nv, float *verts, rcIntArray& idx, rcIntArray& tr
idx[i] = i;
#if defined(_MSC_VER)
qsort_s(&idx[0], idx.size(), sizeof(int), ptcmp, verts);
+#elif defined(__APPLE__)
+ qsort_r(&idx[0], idx.size(), sizeof(int), verts, ptcmp);
#else
qsort_r(&idx[0], idx.size(), sizeof(int), ptcmp, verts);
#endif
diff --git a/source/blender/editors/util/navmesh_conversion.cpp b/source/blender/editors/util/navmesh_conversion.cpp
index aebd9624bc7..4d89f78bdf5 100644
--- a/source/blender/editors/util/navmesh_conversion.cpp
+++ b/source/blender/editors/util/navmesh_conversion.cpp
@@ -280,6 +280,8 @@ struct SortContext
};
#if defined(_MSC_VER)
static int compareByData(void* data, const void * a, const void * b)
+#elif defined(__APPLE__)
+static int compareByData(void* data, const void * a, const void * b)
#else
static int compareByData(const void * a, const void * b, void* data)
#endif
@@ -312,6 +314,8 @@ bool buildNavMeshData(const int nverts, const float* verts,
context.trisToFacesMap = trisToFacesMap;
#if defined(_MSC_VER)
qsort_s(trisMapping, ntris, sizeof(int), compareByData, &context);
+#elif defined(__APPLE__)
+ qsort_r(trisMapping, ntris, sizeof(int), &context, compareByData);
#else
qsort_r(trisMapping, ntris, sizeof(int), compareByData, &context);
#endif
diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
index 9fd87b03d29..26990f6e82b 100644
--- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp
+++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
@@ -520,6 +520,9 @@ void KX_NavMeshObject::DrawNavMesh(NavMeshRenderMode renderMode)
}
}
break;
+ default:
+ /* pass */
+ break;
}
}