Resolve MSVC/OpenMP compat issue
This commit is contained in:
@@ -442,7 +442,7 @@ struct BMBVHTree_OverlapData {
|
||||
float epsilon;
|
||||
};
|
||||
|
||||
static bool bmbvh_overlap_cb(void *userdata, int index_a, int index_b, unsigned int UNUSED(thread))
|
||||
static bool bmbvh_overlap_cb(void *userdata, int index_a, int index_b, int UNUSED(thread))
|
||||
{
|
||||
struct BMBVHTree_OverlapData *data = userdata;
|
||||
const BMBVHTree *bmtree_a = data->tree_pair[0];
|
||||
|
||||
@@ -75,7 +75,7 @@ typedef void (*BVHTree_NearestPointCallback)(void *userdata, int index, const fl
|
||||
typedef void (*BVHTree_RayCastCallback)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit);
|
||||
|
||||
/* callback to check if 2 nodes overlap (use thread if intersection results need to be stored) */
|
||||
typedef bool (*BVHTree_OverlapCallback)(void *userdata, int index_a, int index_b, unsigned int thread);
|
||||
typedef bool (*BVHTree_OverlapCallback)(void *userdata, int index_a, int index_b, int thread);
|
||||
|
||||
/* callback to range search query */
|
||||
typedef void (*BVHTree_RangeQuery)(void *userdata, int index, float dist_sq);
|
||||
@@ -91,7 +91,7 @@ void BLI_bvhtree_balance(BVHTree *tree);
|
||||
bool BLI_bvhtree_update_node(BVHTree *tree, int index, const float co[3], const float co_moving[3], int numpoints);
|
||||
void BLI_bvhtree_update_tree(BVHTree *tree);
|
||||
|
||||
unsigned int BLI_bvhtree_overlap_thread_num(const BVHTree *tree);
|
||||
int BLI_bvhtree_overlap_thread_num(const BVHTree *tree);
|
||||
|
||||
/* collision/overlap: check two trees if they overlap, alloc's *overlap with length of the int return value */
|
||||
BVHTreeOverlap *BLI_bvhtree_overlap(
|
||||
|
||||
@@ -117,7 +117,7 @@ typedef struct BVHOverlapData_Thread {
|
||||
BVHOverlapData_Shared *shared;
|
||||
struct BLI_Stack *overlap; /* store BVHTreeOverlap */
|
||||
/* use for callbacks */
|
||||
unsigned int thread;
|
||||
int thread;
|
||||
} BVHOverlapData_Thread;
|
||||
|
||||
typedef struct BVHNearestData {
|
||||
@@ -1163,9 +1163,9 @@ static void tree_overlap_traverse_cb(
|
||||
*
|
||||
* \warning Must be the first tree passed to #BLI_bvhtree_overlap!
|
||||
*/
|
||||
unsigned int BLI_bvhtree_overlap_thread_num(const BVHTree *tree)
|
||||
int BLI_bvhtree_overlap_thread_num(const BVHTree *tree)
|
||||
{
|
||||
return (unsigned int)MIN2(tree->tree_type, tree->nodes[tree->totleaf]->totnode);
|
||||
return (int)MIN2(tree->tree_type, tree->nodes[tree->totleaf]->totnode);
|
||||
}
|
||||
|
||||
BVHTreeOverlap *BLI_bvhtree_overlap(
|
||||
@@ -1173,12 +1173,12 @@ BVHTreeOverlap *BLI_bvhtree_overlap(
|
||||
/* optional callback to test the overlap before adding (must be thread-safe!) */
|
||||
BVHTree_OverlapCallback callback, void *userdata)
|
||||
{
|
||||
const unsigned int thread_num = BLI_bvhtree_overlap_thread_num(tree1);
|
||||
unsigned int j;
|
||||
const int thread_num = BLI_bvhtree_overlap_thread_num(tree1);
|
||||
int j;
|
||||
size_t total = 0;
|
||||
BVHTreeOverlap *overlap = NULL, *to = NULL;
|
||||
BVHOverlapData_Shared data_shared;
|
||||
BVHOverlapData_Thread *data = BLI_array_alloca(data, thread_num);
|
||||
BVHOverlapData_Thread *data = BLI_array_alloca(data, (size_t)thread_num);
|
||||
axis_t start_axis, stop_axis;
|
||||
|
||||
/* check for compatibility of both trees (can't compare 14-DOP with 18-DOP) */
|
||||
|
||||
@@ -451,7 +451,7 @@ struct PyBVHTree_OverlapData {
|
||||
float epsilon;
|
||||
};
|
||||
|
||||
static bool py_bvhtree_overlap_cb(void *userdata, int index_a, int index_b, unsigned int UNUSED(thread))
|
||||
static bool py_bvhtree_overlap_cb(void *userdata, int index_a, int index_b, int UNUSED(thread))
|
||||
{
|
||||
struct PyBVHTree_OverlapData *data = userdata;
|
||||
PyBVHTree *tree_a = data->tree_pair[0];
|
||||
|
||||
Reference in New Issue
Block a user