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:
Diffstat (limited to 'source/blender/bmesh/bmesh_class.h')
-rw-r--r--source/blender/bmesh/bmesh_class.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h
index cff7da78ef2..f9dbf51a629 100644
--- a/source/blender/bmesh/bmesh_class.h
+++ b/source/blender/bmesh/bmesh_class.h
@@ -48,6 +48,8 @@ struct Object;
* hrm. it doesn't but stull works ok, remove the comment above? - campbell.
*/
+// #pragma GCC diagnostic error "-Wpadded"
+
/**
* BMHeader
*
@@ -69,10 +71,19 @@ typedef struct BMHeader {
* this is abused by various tools which set it dirty.
* - For loops this is used for sorting during tessellation. */
- char htype; /* element geometric type (verts/edges/loops/faces) */
- char hflag; /* this would be a CD layer, see below */
+ char htype; /* element geometric type (verts/edges/loops/faces) */
+ char hflag; /* this would be a CD layer, see below */
+
+ /* internal use only!
+ * note,.we are very picky about not bloating this struct
+ * but in this case its padded up to 16 bytes anyway,
+ * so adding a flag here gives no increase in size */
+ char api_flag;
+// char _pad;
} BMHeader;
+BLI_STATIC_ASSERT((sizeof(BMHeader) <= 16), "BMHeader size has grown!");
+
/* note: need some way to specify custom locations for custom data layers. so we can
* make them point directly into structs. and some way to make it only happen to the
* active layer, and properly update when switching active layers.*/
@@ -122,7 +133,10 @@ typedef struct BMLoop {
/* can cast BMFace/BMEdge/BMVert, but NOT BMLoop, since these don't have a flag layer */
typedef struct BMElemF {
BMHeader head;
- struct BMFlagLayer *oflags; /* keep after header, an array of flags, mostly used by the operator stack */
+
+ /* keep directly after header,
+ * optional array of flags, only used by the operator stack */
+ struct BMFlagLayer *oflags;
} BMElemF;
/* can cast anything to this, including BMLoop */
@@ -142,21 +156,24 @@ typedef struct BMFace {
BMHeader head;
struct BMFlagLayer *oflags; /* an array of flags, mostly used by the operator stack */
- int len; /*includes all boundary loops*/
#ifdef USE_BMESH_HOLES
int totbounds; /*total boundaries, is one plus the number of holes in the face*/
ListBase loops;
#else
BMLoop *l_first;
#endif
- float no[3]; /*yes, we do store this here*/
+ int len; /* includes all boundary loops */
+ float no[3]; /* yes, we do store this here */
short mat_nr;
+// short _pad[3];
} BMFace;
typedef struct BMFlagLayer {
- short f, pflag; /* flags */
+ short f; /* flags */
} BMFlagLayer;
+// #pragma GCC diagnostic ignored "-Wpadded"
+
typedef struct BMesh {
int totvert, totedge, totloop, totface;
int totvertsel, totedgesel, totfacesel;
@@ -166,7 +183,7 @@ typedef struct BMesh {
* valid flags are - BM_VERT | BM_EDGE | BM_FACE.
* BM_LOOP isn't handled so far. */
char elem_index_dirty;
-
+
/*element pools*/
struct BLI_mempool *vpool, *epool, *lpool, *fpool;
@@ -192,7 +209,7 @@ typedef struct BMesh {
int walkers, totflags;
ListBase selected, error_stack;
-
+
BMFace *act_face;
ListBase errorstack;
@@ -243,10 +260,16 @@ enum {
# define BM_FACE_FIRST_LOOP(p) ((p)->l_first)
#endif
-/* size to use for static arrays when dealing with NGons,
+/**
+ * size to use for stack arrays when dealing with NGons,
* alloc after this limit is reached.
* this value is rather arbitrary */
-#define BM_NGON_STACK_SIZE 32
+#define BM_DEFAULT_NGON_STACK_SIZE 32
+/**
+ * size to use for stack arrays dealing with connected mesh data
+ * verts of faces, edges of vert - etc.
+ * often used with #BM_iter_as_arrayN() */
+#define BM_DEFAULT_ITER_STACK_SIZE 16
/* avoid inf loop, this value is arbitrary
* but should not error on valid cases */