Commit: 98f43ba3e4cb0a26eb62ea98e27a313265f8948c
Author: Campbell Barton
Date:   Mon Dec 17 09:55:02 2018 +1100
Branches: master
https://developer.blender.org/rB98f43ba3e4cb0a26eb62ea98e27a313265f8948c

Cleanup: use bit-shifted flag definitions in DNA

===================================================================

M       source/blender/makesdna/DNA_boid_types.h
M       source/blender/makesdna/DNA_camera_types.h
M       source/blender/makesdna/DNA_color_types.h
M       source/blender/makesdna/DNA_constraint_types.h
M       source/blender/makesdna/DNA_image_types.h
M       source/blender/makesdna/DNA_lamp_types.h
M       source/blender/makesdna/DNA_mask_types.h
M       source/blender/makesdna/DNA_material_types.h
M       source/blender/makesdna/DNA_modifier_types.h
M       source/blender/makesdna/DNA_node_types.h
M       source/blender/makesdna/DNA_object_force_types.h
M       source/blender/makesdna/DNA_scene_types.h
M       source/blender/makesdna/DNA_text_types.h
M       source/blender/makesdna/DNA_texture_types.h
M       source/blender/makesdna/DNA_view3d_types.h
M       source/blender/makesdna/DNA_world_types.h

===================================================================

diff --git a/source/blender/makesdna/DNA_boid_types.h 
b/source/blender/makesdna/DNA_boid_types.h
index a161fde119e..43a137f4668 100644
--- a/source/blender/makesdna/DNA_boid_types.h
+++ b/source/blender/makesdna/DNA_boid_types.h
@@ -52,17 +52,17 @@ typedef enum eBoidRuleType {
 } eBoidRuleType;
 
 /* boidrule->flag */
-#define BOIDRULE_CURRENT               1
-#define BOIDRULE_IN_AIR                        4
-#define BOIDRULE_ON_LAND               8
+#define BOIDRULE_CURRENT        (1 << 0)
+#define BOIDRULE_IN_AIR         (1 << 2)
+#define BOIDRULE_ON_LAND        (1 << 3)
 typedef struct BoidRule {
        struct BoidRule *next, *prev;
        int type, flag;
        char name[32];
 } BoidRule;
-#define BRULE_GOAL_AVOID_PREDICT       1
-#define BRULE_GOAL_AVOID_ARRIVE                2
-#define BRULE_GOAL_AVOID_SIGNAL                4
+#define BRULE_GOAL_AVOID_PREDICT    (1 << 0)
+#define BRULE_GOAL_AVOID_ARRIVE     (1 << 1)
+#define BRULE_GOAL_AVOID_SIGNAL     (1 << 2)
 typedef struct BoidRuleGoalAvoid {
        BoidRule rule;
        struct Object *ob;
@@ -72,14 +72,14 @@ typedef struct BoidRuleGoalAvoid {
        /* signals */
        int signal_id, channels;
 } BoidRuleGoalAvoid;
-#define BRULE_ACOLL_WITH_BOIDS         1
-#define BRULE_ACOLL_WITH_DEFLECTORS    2
+#define BRULE_ACOLL_WITH_BOIDS      (1 << 0)
+#define BRULE_ACOLL_WITH_DEFLECTORS (1 << 1)
 typedef struct BoidRuleAvoidCollision {
        BoidRule rule;
        int options;
        float look_ahead;
 } BoidRuleAvoidCollision;
-#define BRULE_LEADER_IN_LINE           1
+#define BRULE_LEADER_IN_LINE        (1 << 0)
 typedef struct BoidRuleFollowLeader {
        BoidRule rule;
        struct Object *ob;
@@ -210,16 +210,16 @@ typedef struct BoidSettings {
 } BoidSettings;
 
 /* boidsettings->options */
-#define BOID_ALLOW_FLIGHT      1
-#define BOID_ALLOW_LAND                2
-#define BOID_ALLOW_CLIMB       4
+#define BOID_ALLOW_FLIGHT   (1 << 0)
+#define BOID_ALLOW_LAND     (1 << 1)
+#define BOID_ALLOW_CLIMB    (1 << 2)
 
 /* boidrule->options */
-//#define BOID_RULE_FOLLOW_LINE        1               /* follow leader */
-//#define BOID_RULE_PREDICT            2               /* goal/avoid */
-//#define BOID_RULE_ARRIVAL            4               /* goal */
-//#define BOID_RULE_LAND                       8               /* goal */
-//#define BOID_RULE_WITH_BOIDS 16              /* avoid collision */
-//#define BOID_RULE_WITH_DEFLECTORS    32      /* avoid collision */
+//#define BOID_RULE_FOLLOW_LINE     (1 << 0)        /* follow leader */
+//#define BOID_RULE_PREDICT         (1 << 1)        /* goal/avoid */
+//#define BOID_RULE_ARRIVAL         (1 << 2)        /* goal */
+//#define BOID_RULE_LAND            (1 << 3)        /* goal */
+//#define BOID_RULE_WITH_BOIDS      (1 << 4)        /* avoid collision */
+//#define BOID_RULE_WITH_DEFLECTORS (1 << 5)    /* avoid collision */
 
 #endif
diff --git a/source/blender/makesdna/DNA_camera_types.h 
b/source/blender/makesdna/DNA_camera_types.h
index 961f32246d3..0dedd8c84ef 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -126,9 +126,6 @@ enum {
        CAM_SHOW_SAFE_CENTER    = (1 << 9),
 };
 
-/* yafray: dof sampling switch */
-/* #define CAM_YF_NO_QMC       512 */ /* deprecated */
-
 /* Sensor fit */
 enum {
        CAMERA_SENSOR_FIT_AUTO  = 0,
diff --git a/source/blender/makesdna/DNA_color_types.h 
b/source/blender/makesdna/DNA_color_types.h
index 8ed38b0b05d..1c9b6278c73 100644
--- a/source/blender/makesdna/DNA_color_types.h
+++ b/source/blender/makesdna/DNA_color_types.h
@@ -48,9 +48,9 @@ typedef struct CurveMapPoint {
 
 /* curvepoint->flag */
 enum {
-       CUMA_SELECT = 1,
-       CUMA_HANDLE_VECTOR = 2,
-       CUMA_HANDLE_AUTO_ANIM = 4,
+       CUMA_SELECT = (1 << 0),
+       CUMA_HANDLE_VECTOR = (1 << 1),
+       CUMA_HANDLE_AUTO_ANIM = (1 << 2),
 };
 
 typedef struct CurveMap {
@@ -85,10 +85,10 @@ typedef struct CurveMapping {
 } CurveMapping;
 
 /* cumapping->flag */
-#define CUMA_DO_CLIP                   1
-#define CUMA_PREMULLED                 2
-#define CUMA_DRAW_CFRA                 4
-#define CUMA_DRAW_SAMPLE               8
+#define CUMA_DO_CLIP            (1 << 0)
+#define CUMA_PREMULLED          (1 << 1)
+#define CUMA_DRAW_CFRA          (1 << 2)
+#define CUMA_DRAW_SAMPLE        (1 << 3)
 
 /* cumapping->preset */
 typedef enum eCurveMappingPreset {
diff --git a/source/blender/makesdna/DNA_constraint_types.h 
b/source/blender/makesdna/DNA_constraint_types.h
index e49cd65fa9b..424c3ed7dd0 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -842,8 +842,8 @@ typedef enum eObjectSolver_Flags {
 } eObjectSolver_Flags;
 
 /* Rigid-Body Constraint */
-#define CONSTRAINT_DRAW_PIVOT 0x40
-#define        CONSTRAINT_DISABLE_LINKED_COLLISION 0x80
+#define CONSTRAINT_DRAW_PIVOT (1 << 6)
+#define CONSTRAINT_DISABLE_LINKED_COLLISION (1 << 7)
 
 /* ObjectSolver Constraint -> flag */
 typedef enum eStretchTo_Flags {
@@ -852,10 +852,10 @@ typedef enum eStretchTo_Flags {
 } eStretchTo_Flags;
 
 /* important: these defines need to match up with PHY_DynamicTypes headerfile 
*/
-#define        CONSTRAINT_RB_BALL              1
-#define        CONSTRAINT_RB_HINGE             2
-#define        CONSTRAINT_RB_CONETWIST 4
-#define        CONSTRAINT_RB_VEHICLE   11
-#define        CONSTRAINT_RB_GENERIC6DOF 12
+#define CONSTRAINT_RB_BALL      1
+#define CONSTRAINT_RB_HINGE     2
+#define CONSTRAINT_RB_CONETWIST 4
+#define CONSTRAINT_RB_VEHICLE   11
+#define CONSTRAINT_RB_GENERIC6DOF 12
 
 #endif
diff --git a/source/blender/makesdna/DNA_image_types.h 
b/source/blender/makesdna/DNA_image_types.h
index 760e9b5461e..cc4df10a2a2 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -84,11 +84,11 @@ typedef struct RenderSlot {
 } RenderSlot;
 
 /* iuser->flag */
-#define        IMA_ANIM_ALWAYS         1
-#define IMA_ANIM_REFRESHED     2
-/* #define IMA_DO_PREMUL       4 */
-#define IMA_NEED_FRAME_RECALC  8
-#define IMA_SHOW_STEREO                16
+#define IMA_ANIM_ALWAYS         (1 << 0)
+#define IMA_ANIM_REFRESHED      (1 << 1)
+/* #define IMA_DO_PREMUL        (1 << 2) */
+#define IMA_NEED_FRAME_RECALC   (1 << 3)
+#define IMA_SHOW_STEREO         (1 << 4)
 
 enum {
        TEXTARGET_TEXTURE_2D = 0,
@@ -184,20 +184,20 @@ enum {
 };
 
 /* Image.tpageflag */
-#define IMA_TILES                      1
-#define IMA_TWINANIM           2
-#define IMA_COLCYCLE           4       /* Depreciated */
-#define IMA_MIPMAP_COMPLETE 8   /* all mipmap levels in OpenGL texture set? */
-#define IMA_CLAMP_U                    16
-#define IMA_CLAMP_V                    32
-#define IMA_TPAGE_REFRESH      64
-#define IMA_GLBIND_IS_DATA     128 /* opengl image texture bound as non-color 
data */
+#define IMA_TILES           (1 << 0)
+#define IMA_TWINANIM        (1 << 1)
+#define IMA_COLCYCLE        (1 << 2)    /* Depreciated */
+#define IMA_MIPMAP_COMPLETE (1 << 3)   /* all mipmap levels in OpenGL texture 
set? */
+#define IMA_CLAMP_U         (1 << 4)
+#define IMA_CLAMP_V         (1 << 5)
+#define IMA_TPAGE_REFRESH   (1 << 6)
+#define IMA_GLBIND_IS_DATA  (1 << 7) /* opengl image texture bound as 
non-color data */
 
 /* ima->type and ima->source moved to BKE_image.h, for API */
 
 /* render */
-#define IMA_MAX_RENDER_TEXT            512
-#define IMA_MAX_RENDER_SLOT            8
+#define IMA_MAX_RENDER_TEXT     (1 << 9)
+#define IMA_MAX_RENDER_SLOT     (1 << 3)
 
 /* gen_flag */
 #define IMA_GEN_FLOAT          1
diff --git a/source/blender/makesdna/DNA_lamp_types.h 
b/source/blender/makesdna/DNA_lamp_types.h
index ca1a07fbcae..9f1b404e151 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -116,11 +116,11 @@ typedef struct Lamp {
 /* **************** LAMP ********************* */
 
 /* flag */
-#define LA_DS_EXPAND   1
+#define LA_DS_EXPAND    (1 << 0)
        /* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
         * otherwise anim-editors will not read correctly
         */
-#define LA_DS_SHOW_TEXS        4
+#define LA_DS_SHOW_TEXS (1 << 2)
 
 /* type */
 #define LA_LOCAL               0
@@ -158,8 +158,8 @@ typedef struct Lamp {
 #define LA_LAYER_SHADOW_RECEIVE        2
 
 /* sun effect type*/
-#define LA_SUN_EFFECT_SKY                      1
-#define LA_SUN_EFFECT_AP                       2
+#define LA_SUN_EFFECT_SKY           (1 << 0)
+#define LA_SUN_EFFECT_AP            (1 << 1)
 
 /* falloff_type */
 #define LA_FALLOFF_CONSTANT                    0
@@ -177,8 +177,8 @@ typedef struct Lamp {
 #define LA_SHADBUF_DEEP                        3
 
 /* bufflag, auto clipping */
-#define LA_SHADBUF_AUTO_START  1
-#define LA_SHADBUF_AUTO_END            2
+#define LA_SHADBUF_AUTO_START   (1 << 0)
+#define LA_SHADBUF_AUTO_END     (1 << 1)
 
 /* filtertype */
 #define LA_SHADBUF_BOX         0
@@ -198,14 +198,14 @@ typedef struct Lamp {
 
 
 /* ray_samp_type */
-// #define LA_SAMP_ROUND       1  // UNUSED
-#define LA_SAMP_UMBRA  2
-#define LA_SAMP_DITHER 4
-#define LA_SAMP_JITTER 8
+// #define LA_SAMP_ROUND    (1 << 0)  // UNUSED
+#define LA_SAMP_UMBRA   (1 << 1)
+#define LA_SAMP_DITHER  (1 << 2)
+#define LA_SAMP_JITTER  (1 << 3)
 
 /* mapto */
-#define LAMAP_COL              1
-#define LAMAP_SHAD             2
+#define LAMAP_COL       (1 << 0)
+#define LAMAP_SHAD      (1 << 1)
 
 /* shadowmap_type */
 #define LA_SHADMAP_SIMPLE      0
diff --git a/source/blender/makesdna/DNA_mask_types.h 
b/source/blender/makesdna/DNA_mask_types.h
index 9d4b68b7242..2c6fccae158 100644
--- a/source/blender/makesdna/DNA_mask_types.h
+++ b/source/blender/makesdna/DNA_mask_types.h
@@ -172,13 +172,13 @@ enum {
 
 
 /* ob->restrictflag */
-#define MASK_RESTRICT_VIEW      1
-#define MASK_RESTRICT_SELECT    2
-#define MASK_RESTRICT_RENDER    4
+#define MASK_RESTRICT_VIEW      (1 << 0)
+#define MASK_RESTRICT_SELECT    (1 << 1)
+#define MASK_RESTRICT_RENDER    (1 << 2)
 
 /* SpaceClip->mask_draw_flag */
-#define MASK_DRAWFLAG_SMOOTH    1
-#define MASK_DRAWFLAG_OVERLAY   2
+#define MASK_DRAWFLAG_SMOOTH    (1 << 0)
+#define MASK_DRAWFLAG_OVERLAY   (1 << 1)
 
 /* copy of eSpaceImage_UVDT */
 /* SpaceClip->mask_draw_type */
diff --git a/source/blender/makesdna/DNA_material_types.h 
b/source/blender/makesdna/DNA_material_types.h
index dfe7b441c71..f024a3a3e9c 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -209,25 +209,25 @@ typedef struct Material {
 
 /* **************** GAME PROPERTIES ********************* */
 // Blend Transparency Options - alpha_blend /* match 
GPU_material::GPUBlendMode */
-#define GEMAT_SOLID            0 /* GPU_BLEND_SOLID */
-#define GEMAT_ADD              1 /* GPU_BLEND_ADD */
-#define        GEMAT_ALPHA             2 /* GPU_BLEND_ALPHA */
-#define GEMAT_CLIP             4 /* GPU_BLEND_CLIP */
-#define        GEMAT_ALPHA_SORT        8 /* GPU_BLEND_ALPHA_SORT */
-#define        GEMAT_ALPHA_TO_COVERAGE 16 /* GPU_BLEND_ALPHA_TO_COVERAGE */
+#define GEMAT_SOLID             0 /* GPU_

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to