UI: Asset Shelf (Experimental Feature) #104831
|
@ -256,9 +256,7 @@ static bool library_foreach_ID_link(Main *bmain,
|
|||
} \
|
||||
((void)0)
|
||||
|
||||
for (; id != nullptr; id = (flag & IDWALK_RECURSE) ?
|
||||
static_cast<ID *>(BLI_LINKSTACK_POP(data.ids_todo)) :
|
||||
nullptr)
|
||||
for (; id != nullptr; id = (flag & IDWALK_RECURSE) ? BLI_LINKSTACK_POP(data.ids_todo) : nullptr)
|
||||
{
|
||||
data.self_id = id;
|
||||
/* Note that we may call this functions sometime directly on an embedded ID, without any
|
||||
|
|
|
@ -36,18 +36,28 @@
|
|||
|
||||
#define BLI_LINKSTACK_SIZE(var) BLI_mempool_len(var##_pool_)
|
||||
|
||||
/* check for typeof() */
|
||||
#ifdef __GNUC__
|
||||
/* Check for `decltype()` or `typeof()` support. */
|
||||
#if defined(__cplusplus)
|
||||
# define BLI_LINKSTACK_PUSH(var, ptr) \
|
||||
(CHECK_TYPE_INLINE_NONCONST(ptr, decltype(var##_type_)), \
|
||||
BLI_linklist_prepend_pool(&(var), ptr, var##_pool_))
|
||||
# define BLI_LINKSTACK_POP(var) \
|
||||
(decltype(var##_type_))(var ? BLI_linklist_pop_pool(&(var), var##_pool_) : NULL)
|
||||
# define BLI_LINKSTACK_POP_DEFAULT(var, r) \
|
||||
(decltype(var##_type_))(var ? BLI_linklist_pop_pool(&(var), var##_pool_) : r)
|
||||
#elif defined(__GNUC__)
|
||||
# define BLI_LINKSTACK_PUSH(var, ptr) \
|
||||
(CHECK_TYPE_INLINE_NONCONST(ptr, typeof(var##_type_)), \
|
||||
BLI_linklist_prepend_pool(&(var), ptr, var##_pool_))
|
||||
# define BLI_LINKSTACK_POP(var) (var ? BLI_linklist_pop_pool(&(var), var##_pool_) : NULL)
|
||||
# define BLI_LINKSTACK_POP_DEFAULT(var, r) (var ? BLI_linklist_pop_pool(&(var), var##_pool_) : r)
|
||||
#else /* non gcc */
|
||||
# define BLI_LINKSTACK_POP(var) \
|
||||
(typeof(var##_type_))(var ? BLI_linklist_pop_pool(&(var), var##_pool_) : NULL)
|
||||
# define BLI_LINKSTACK_POP_DEFAULT(var, r) \
|
||||
(typeof(var##_type_))(var ? BLI_linklist_pop_pool(&(var), var##_pool_) : r)
|
||||
#else /* Non GCC/C++. */
|
||||
# define BLI_LINKSTACK_PUSH(var, ptr) (BLI_linklist_prepend_pool(&(var), ptr, var##_pool_))
|
||||
# define BLI_LINKSTACK_POP(var) (var ? BLI_linklist_pop_pool(&(var), var##_pool_) : NULL)
|
||||
# define BLI_LINKSTACK_POP_DEFAULT(var, r) (var ? BLI_linklist_pop_pool(&(var), var##_pool_) : r)
|
||||
#endif /* gcc check */
|
||||
#endif
|
||||
|
||||
#define BLI_LINKSTACK_SWAP(var_a, var_b) \
|
||||
{ \
|
||||
|
|
|
@ -200,7 +200,7 @@ void bmo_connect_verts_exec(BMesh *bm, BMOperator *op)
|
|||
}
|
||||
|
||||
/* connect faces */
|
||||
while ((f = (BMFace *)BLI_LINKSTACK_POP(faces))) {
|
||||
while ((f = BLI_LINKSTACK_POP(faces))) {
|
||||
if (bm_face_connect_verts(bm, f, check_degenerate) == -1) {
|
||||
BMO_error_raise(bm, op, BMO_ERROR_FATAL, "Could not connect vertices");
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ void bmo_connect_verts_nonplanar_exec(BMesh *bm, BMOperator *op)
|
|||
}
|
||||
}
|
||||
|
||||
while ((f = (BMFace *)BLI_LINKSTACK_POP(fstack))) {
|
||||
while ((f = BLI_LINKSTACK_POP(fstack))) {
|
||||
BMFace *f_pair[2];
|
||||
if (bm_face_split_by_angle(bm, f, f_pair, angle_limit_cos)) {
|
||||
int j;
|
||||
|
|
|
@ -100,7 +100,7 @@ static uint bmesh_face_attribute_fill(BMesh *bm, const bool use_normals, const b
|
|||
}
|
||||
|
||||
while (BLI_LINKSTACK_SIZE(loop_queue_prev)) {
|
||||
while ((l = (BMLoop *)BLI_LINKSTACK_POP(loop_queue_prev))) {
|
||||
while ((l = BLI_LINKSTACK_POP(loop_queue_prev))) {
|
||||
/* check we're still un-assigned */
|
||||
if (BM_elem_flag_test(l->f, BM_ELEM_TAG)) {
|
||||
BMLoop *l_iter;
|
||||
|
|
|
@ -215,7 +215,7 @@ static void bmo_recalc_face_normals_array(BMesh *bm,
|
|||
BLI_LINKSTACK_PUSH(fstack, faces[f_start_index]);
|
||||
BMO_face_flag_enable(bm, faces[f_start_index], FACE_TEMP);
|
||||
|
||||
while ((f = (BMFace *)BLI_LINKSTACK_POP(fstack))) {
|
||||
while ((f = BLI_LINKSTACK_POP(fstack))) {
|
||||
const bool flip_state = BMO_face_flag_test_bool(bm, f, FACE_FLIP);
|
||||
BMLoop *l_iter, *l_first;
|
||||
|
||||
|
|
|
@ -551,7 +551,7 @@ void BM_mesh_bisect_plane(BMesh *bm,
|
|||
|
||||
MEM_freeN(edges_arr);
|
||||
|
||||
while ((f = (BMFace *)BLI_LINKSTACK_POP(face_stack))) {
|
||||
while ((f = BLI_LINKSTACK_POP(face_stack))) {
|
||||
bm_face_bisect_verts(bm, f, plane, oflag_center, oflag_new);
|
||||
}
|
||||
|
||||
|
|
|
@ -1096,7 +1096,7 @@ static BMEdge *bm_face_region_pivot_edge_find(BMFace **faces_region,
|
|||
|
||||
while (BLI_LINKSTACK_SIZE(vert_queue_prev)) {
|
||||
BMVert *v;
|
||||
while ((v = (BMVert *)BLI_LINKSTACK_POP(vert_queue_prev))) {
|
||||
while ((v = BLI_LINKSTACK_POP(vert_queue_prev))) {
|
||||
BMIter eiter;
|
||||
BMEdge *e;
|
||||
BLI_assert(BLI_ghash_haskey(gh, v));
|
||||
|
|
|
@ -421,7 +421,7 @@ void calc_distanceCurveVerts(TransData *head, TransData *tail, bool cyclic)
|
|||
}
|
||||
}
|
||||
|
||||
while ((td = static_cast<TransData *>(BLI_LINKSTACK_POP(queue)))) {
|
||||
while ((td = BLI_LINKSTACK_POP(queue))) {
|
||||
float dist;
|
||||
float vec[3];
|
||||
|
||||
|
|
|
@ -1072,7 +1072,7 @@ void transform_convert_mesh_connectivity_distance(BMesh *bm,
|
|||
do {
|
||||
BMEdge *e;
|
||||
|
||||
while ((e = static_cast<BMEdge *>(BLI_LINKSTACK_POP(queue)))) {
|
||||
while ((e = BLI_LINKSTACK_POP(queue))) {
|
||||
BMVert *v1 = e->v1;
|
||||
BMVert *v2 = e->v2;
|
||||
int i1 = BM_elem_index_get(v1);
|
||||
|
|
|
@ -132,7 +132,7 @@ static void uv_set_connectivity_distance(const ToolSettings *ts,
|
|||
float *dists_prev = static_cast<float *>(MEM_dupallocN(dists));
|
||||
|
||||
do {
|
||||
while ((l = static_cast<BMLoop *>(BLI_LINKSTACK_POP(queue)))) {
|
||||
while ((l = BLI_LINKSTACK_POP(queue))) {
|
||||
BLI_assert(dists[BM_elem_index_get(l)] != FLT_MAX);
|
||||
|
||||
BMLoop *l_other, *l_connected;
|
||||
|
|
Loading…
Reference in New Issue