diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/makesdna/DNA_meshdata_types.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/makesdna/DNA_meshdata_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_meshdata_types.h | 320 |
1 files changed, 161 insertions, 159 deletions
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 5f86ee562f9..ee12f47051c 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -31,59 +31,59 @@ struct Image; /*tessellation face, see MLoop/MPoly for the real face data*/ typedef struct MFace { - unsigned int v1, v2, v3, v4; - short mat_nr; - /** We keep edcode, for conversion to edges draw flags in old files. */ - char edcode, flag; + unsigned int v1, v2, v3, v4; + short mat_nr; + /** We keep edcode, for conversion to edges draw flags in old files. */ + char edcode, flag; } MFace; typedef struct MEdge { - unsigned int v1, v2; - char crease, bweight; - short flag; + unsigned int v1, v2; + char crease, bweight; + short flag; } MEdge; typedef struct MDeformWeight { - int def_nr; - float weight; + int def_nr; + float weight; } MDeformWeight; typedef struct MDeformVert { - struct MDeformWeight *dw; - int totweight; - /** Flag only in use for weightpaint now. */ - int flag; + struct MDeformWeight *dw; + int totweight; + /** Flag only in use for weightpaint now. */ + int flag; } MDeformVert; typedef struct MVert { - float co[3]; - short no[3]; - char flag, bweight; + float co[3]; + short no[3]; + char flag, bweight; } MVert; /* tessellation vertex color data. * at the moment alpha is abused for vertex painting and not used for transparency, note that red and blue are swapped */ typedef struct MCol { - unsigned char a, r, g, b; + unsigned char a, r, g, b; } MCol; /* new face structure, replaces MFace, which is now only used for storing tessellations.*/ typedef struct MPoly { - /* offset into loop array and number of loops in the face */ - int loopstart; - /** Keep signed since we need to subtract when getting the previous loop. */ - int totloop; - short mat_nr; - char flag, _pad; + /* offset into loop array and number of loops in the face */ + int loopstart; + /** Keep signed since we need to subtract when getting the previous loop. */ + int totloop; + short mat_nr; + char flag, _pad; } MPoly; /* the e here is because we want to move away from relying on edge hashes.*/ typedef struct MLoop { - /** Vertex index. */ - unsigned int v; - /** Edge index. */ - unsigned int e; + /** Vertex index. */ + unsigned int v; + /** Edge index. */ + unsigned int e; } MLoop; /** @@ -174,29 +174,29 @@ typedef struct MLoop { * \note A #MLoopTri may be in the middle of an ngon and not reference **any** edges. */ typedef struct MLoopTri { - unsigned int tri[3]; - unsigned int poly; + unsigned int tri[3]; + unsigned int poly; } MLoopTri; # # typedef struct MVertTri { - unsigned int tri[3]; + unsigned int tri[3]; } MVertTri; //typedef struct MTexPoly { -// void *_pad; +// void *_pad; //} MTexPoly; typedef struct MLoopUV { - float uv[2]; - int flag; + float uv[2]; + int flag; } MLoopUV; /*mloopuv->flag*/ enum { - MLOOPUV_EDGESEL = (1 << 0), - MLOOPUV_VERTSEL = (1 << 1), - MLOOPUV_PINNED = (1 << 2), + MLOOPUV_EDGESEL = (1 << 0), + MLOOPUV_VERTSEL = (1 << 1), + MLOOPUV_PINNED = (1 << 2), }; /** @@ -208,227 +208,229 @@ enum { * \note red and blue are _not_ swapped, as they are with #MCol */ typedef struct MLoopCol { - unsigned char r, g, b, a; + unsigned char r, g, b, a; } MLoopCol; #define MESH_MLOOPCOL_FROM_MCOL(_mloopcol, _mcol) \ -{ \ - MLoopCol *mloopcol__tmp = _mloopcol; \ - const MCol *mcol__tmp = _mcol; \ - mloopcol__tmp->r = mcol__tmp->b; \ - mloopcol__tmp->g = mcol__tmp->g; \ - mloopcol__tmp->b = mcol__tmp->r; \ - mloopcol__tmp->a = mcol__tmp->a; \ -} (void)0 - + { \ + MLoopCol *mloopcol__tmp = _mloopcol; \ + const MCol *mcol__tmp = _mcol; \ + mloopcol__tmp->r = mcol__tmp->b; \ + mloopcol__tmp->g = mcol__tmp->g; \ + mloopcol__tmp->b = mcol__tmp->r; \ + mloopcol__tmp->a = mcol__tmp->a; \ + } \ + (void)0 #define MESH_MLOOPCOL_TO_MCOL(_mloopcol, _mcol) \ -{ \ - const MLoopCol *mloopcol__tmp = _mloopcol; \ - MCol *mcol__tmp = _mcol; \ - mcol__tmp->b = mloopcol__tmp->r; \ - mcol__tmp->g = mloopcol__tmp->g; \ - mcol__tmp->r = mloopcol__tmp->b; \ - mcol__tmp->a = mloopcol__tmp->a; \ -} (void)0 + { \ + const MLoopCol *mloopcol__tmp = _mloopcol; \ + MCol *mcol__tmp = _mcol; \ + mcol__tmp->b = mloopcol__tmp->r; \ + mcol__tmp->g = mloopcol__tmp->g; \ + mcol__tmp->r = mloopcol__tmp->b; \ + mcol__tmp->a = mloopcol__tmp->a; \ + } \ + (void)0 typedef struct MSelect { - int index; - /** ME_VSEL/ME_ESEL/ME_FSEL. */ - int type; + int index; + /** ME_VSEL/ME_ESEL/ME_FSEL. */ + int type; } MSelect; /*tessellation uv face data*/ typedef struct MTFace { - float uv[4][2]; + float uv[4][2]; } MTFace; /*Custom Data Properties*/ typedef struct MFloatProperty { - float f; + float f; } MFloatProperty; typedef struct MIntProperty { - int i; + int i; } MIntProperty; typedef struct MStringProperty { - char s[255], s_len; + char s[255], s_len; } MStringProperty; typedef struct OrigSpaceFace { - float uv[4][2]; + float uv[4][2]; } OrigSpaceFace; typedef struct OrigSpaceLoop { - float uv[2]; + float uv[2]; } OrigSpaceLoop; typedef struct MDisps { - /* Strange bug in SDNA: if disps pointer comes first, it fails to see totdisp */ - int totdisp; - int level; - float (*disps)[3]; - - /** - * Used for hiding parts of a multires mesh. - * Essentially the multires equivalent of MVert.flag's ME_HIDE bit. - * - * \note This is a bitmap, keep in sync with type used in BLI_bitmap.h - */ - unsigned int *hidden; + /* Strange bug in SDNA: if disps pointer comes first, it fails to see totdisp */ + int totdisp; + int level; + float (*disps)[3]; + + /** + * Used for hiding parts of a multires mesh. + * Essentially the multires equivalent of MVert.flag's ME_HIDE bit. + * + * \note This is a bitmap, keep in sync with type used in BLI_bitmap.h + */ + unsigned int *hidden; } MDisps; /** Multires structs kept for compatibility with old files. */ typedef struct MultiresCol { - float a, r, g, b; + float a, r, g, b; } MultiresCol; typedef struct MultiresColFace { - /* vertex colors */ - MultiresCol col[4]; + /* vertex colors */ + MultiresCol col[4]; } MultiresColFace; typedef struct MultiresFace { - unsigned int v[4]; - unsigned int mid; - char flag, mat_nr, _pad[2]; + unsigned int v[4]; + unsigned int mid; + char flag, mat_nr, _pad[2]; } MultiresFace; typedef struct MultiresEdge { - unsigned int v[2]; - unsigned int mid; + unsigned int v[2]; + unsigned int mid; } MultiresEdge; typedef struct MultiresLevel { - struct MultiresLevel *next, *prev; + struct MultiresLevel *next, *prev; - MultiresFace *faces; - MultiresColFace *colfaces; - MultiresEdge *edges; + MultiresFace *faces; + MultiresColFace *colfaces; + MultiresEdge *edges; - unsigned int totvert, totface, totedge; - char _pad[4]; + unsigned int totvert, totface, totedge; + char _pad[4]; - /* Kept for compatibility with even older files */ - MVert *verts; + /* Kept for compatibility with even older files */ + MVert *verts; } MultiresLevel; typedef struct Multires { - ListBase levels; - MVert *verts; + ListBase levels; + MVert *verts; - unsigned char level_count, current, newlvl, edgelvl, pinlvl, renderlvl; - unsigned char use_col, flag; + unsigned char level_count, current, newlvl, edgelvl, pinlvl, renderlvl; + unsigned char use_col, flag; - /* Special level 1 data that cannot be modified from other levels */ - CustomData vdata; - CustomData fdata; - short *edge_flags; - char *edge_creases; + /* Special level 1 data that cannot be modified from other levels */ + CustomData vdata; + CustomData fdata; + short *edge_flags; + char *edge_creases; } Multires; /* End Multires */ typedef struct MRecast { - int i; + int i; } MRecast; typedef struct GridPaintMask { - /* The data array contains gridsize*gridsize elements */ - float *data; + /* The data array contains gridsize*gridsize elements */ + float *data; - /* The maximum multires level associated with this grid */ - unsigned int level; + /* The maximum multires level associated with this grid */ + unsigned int level; - char _pad[4]; + char _pad[4]; } GridPaintMask; typedef enum eMVertSkinFlag { - /** Marks a vertex as the edge-graph root, used for calculating rotations for all connected - * edges (recursively). Also used to choose a root when generating an armature. - */ - MVERT_SKIN_ROOT = 1, - - /** Marks a branch vertex (vertex with more than two connected edges), so that it's neighbors - * are directly hulled together, rather than the default of generating intermediate frames. - */ - MVERT_SKIN_LOOSE = 2, + /** Marks a vertex as the edge-graph root, used for calculating rotations for all connected + * edges (recursively). Also used to choose a root when generating an armature. + */ + MVERT_SKIN_ROOT = 1, + + /** Marks a branch vertex (vertex with more than two connected edges), so that it's neighbors + * are directly hulled together, rather than the default of generating intermediate frames. + */ + MVERT_SKIN_LOOSE = 2, } eMVertSkinFlag; typedef struct MVertSkin { - /* Radii of the skin, define how big the generated frames are. - * Currently only the first two elements are used. */ - float radius[3]; + /* Radii of the skin, define how big the generated frames are. + * Currently only the first two elements are used. */ + float radius[3]; - /* eMVertSkinFlag */ - int flag; + /* eMVertSkinFlag */ + int flag; } MVertSkin; typedef struct FreestyleEdge { - char flag; - char _pad[3]; + char flag; + char _pad[3]; } FreestyleEdge; /* FreestyleEdge->flag */ enum { - FREESTYLE_EDGE_MARK = 1, + FREESTYLE_EDGE_MARK = 1, }; typedef struct FreestyleFace { - char flag; - char _pad[3]; + char flag; + char _pad[3]; } FreestyleFace; /* FreestyleFace->flag */ enum { - FREESTYLE_FACE_MARK = 1, + FREESTYLE_FACE_MARK = 1, }; /* mvert->flag */ enum { -/* SELECT = (1 << 0), */ - ME_VERT_TMP_TAG = (1 << 2), - ME_HIDE = (1 << 4), -/* ME_VERT_MERGED = (1 << 6), */ - ME_VERT_PBVH_UPDATE = (1 << 7), + /* SELECT = (1 << 0), */ + ME_VERT_TMP_TAG = (1 << 2), + ME_HIDE = (1 << 4), + /* ME_VERT_MERGED = (1 << 6), */ + ME_VERT_PBVH_UPDATE = (1 << 7), }; /* medge->flag */ enum { -/* SELECT = (1 << 0), */ - ME_EDGEDRAW = (1 << 1), - ME_SEAM = (1 << 2), -/* ME_HIDE = (1 << 4), */ - ME_EDGERENDER = (1 << 5), - ME_LOOSEEDGE = (1 << 7), - ME_EDGE_TMP_TAG = (1 << 8), - ME_SHARP = (1 << 9), /* only reason this flag remains a 'short' */ + /* SELECT = (1 << 0), */ + ME_EDGEDRAW = (1 << 1), + ME_SEAM = (1 << 2), + /* ME_HIDE = (1 << 4), */ + ME_EDGERENDER = (1 << 5), + ME_LOOSEEDGE = (1 << 7), + ME_EDGE_TMP_TAG = (1 << 8), + ME_SHARP = (1 << 9), /* only reason this flag remains a 'short' */ }; /* puno = vertexnormal (mface) */ enum { - ME_PROJXY = (1 << 4), - ME_PROJXZ = (1 << 5), - ME_PROJYZ = (1 << 6), + ME_PROJXY = (1 << 4), + ME_PROJXZ = (1 << 5), + ME_PROJYZ = (1 << 6), }; /* edcode (mface) */ enum { - ME_V1V2 = (1 << 0), - ME_V2V3 = (1 << 1), - ME_V3V1 = (1 << 2), - ME_V3V4 = ME_V3V1, - ME_V4V1 = (1 << 3), + ME_V1V2 = (1 << 0), + ME_V2V3 = (1 << 1), + ME_V3V1 = (1 << 2), + ME_V3V4 = ME_V3V1, + ME_V4V1 = (1 << 3), }; /* flag (mface) */ enum { - ME_SMOOTH = (1 << 0), - ME_FACE_SEL = (1 << 1), -/* ME_HIDE = (1 << 4), */ + ME_SMOOTH = (1 << 0), + ME_FACE_SEL = (1 << 1), + /* ME_HIDE = (1 << 4), */ }; -#define ME_POLY_LOOP_PREV(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)]) -#define ME_POLY_LOOP_NEXT(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + 1) % (mp)->totloop)]) +#define ME_POLY_LOOP_PREV(mloop, mp, i) \ + (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)]) +#define ME_POLY_LOOP_NEXT(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + 1) % (mp)->totloop)]) /* number of tri's that make up this polygon once tessellated */ #define ME_POLY_TRI_TOT(mp) ((mp)->totloop - 2) @@ -439,15 +441,15 @@ enum { * So usage such as array lookup needs to check. */ #define ME_MAT_NR_TEST(mat_nr, totmat) \ - (CHECK_TYPE_ANY(mat_nr, short, const short), \ - CHECK_TYPE_ANY(totmat, short, const short), \ - (LIKELY(mat_nr < totmat) ? mat_nr : 0)) + (CHECK_TYPE_ANY(mat_nr, short, const short), \ + CHECK_TYPE_ANY(totmat, short, const short), \ + (LIKELY(mat_nr < totmat) ? mat_nr : 0)) /* mselect->type */ enum { - ME_VSEL = 0, - ME_ESEL = 1, - ME_FSEL = 2, + ME_VSEL = 0, + ME_ESEL = 1, + ME_FSEL = 2, }; -#endif /* __DNA_MESHDATA_TYPES_H__ */ +#endif /* __DNA_MESHDATA_TYPES_H__ */ |