diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-20 12:39:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-20 12:39:25 +0300 |
commit | 08f4cdebe40a5ad5f45f37a07bf0f64c17cecb34 (patch) | |
tree | e41a440ad8d1b3151c1d48c238d10f9aa056712f /source/blender/makesrna | |
parent | bbc5c1e36fc93e33fce4156f5064dfebe1129a57 (diff) |
Cleanup: de-duplicate flag setting macro
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_rigidbody.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index 242bc63c09f..799705df2b4 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -146,14 +146,6 @@ static const EnumPropertyItem rigidbody_mesh_source_items[] = { # include "WM_api.h" -# define RB_FLAG_SET(dest, value, flag) \ - { \ - if (value) \ - dest |= flag; \ - else \ - dest &= ~flag; \ - } - /* ******************************** */ static void rna_RigidBodyWorld_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) @@ -185,7 +177,7 @@ static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, bool value) { RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data; - RB_FLAG_SET(rbw->flag, value, RBW_FLAG_USE_SPLIT_IMPULSE); + SET_FLAG_FROM_TEST(rbw->flag, value, RBW_FLAG_USE_SPLIT_IMPULSE); # ifdef WITH_BULLET if (rbw->shared->physics_world) { @@ -266,7 +258,7 @@ static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, bool value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - RB_FLAG_SET(rbo->flag, !value, RBO_FLAG_DISABLED); + SET_FLAG_FROM_TEST(rbo->flag, !value, RBO_FLAG_DISABLED); # ifdef WITH_BULLET /* update kinematic state if necessary - only needed for active bodies */ @@ -348,7 +340,7 @@ static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, bool value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - RB_FLAG_SET(rbo->flag, value, RBO_FLAG_KINEMATIC); + SET_FLAG_FROM_TEST(rbo->flag, value, RBO_FLAG_KINEMATIC); # ifdef WITH_BULLET /* update kinematic state if necessary */ @@ -364,7 +356,7 @@ static void rna_RigidBodyOb_activation_state_set(PointerRNA *ptr, bool value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - RB_FLAG_SET(rbo->flag, value, RBO_FLAG_USE_DEACTIVATION); + SET_FLAG_FROM_TEST(rbo->flag, value, RBO_FLAG_USE_DEACTIVATION); # ifdef WITH_BULLET /* update activation state if necessary - only active bodies can be deactivated */ @@ -456,7 +448,7 @@ static void rna_RigidBodyCon_enabled_set(PointerRNA *ptr, bool value) { RigidBodyCon *rbc = (RigidBodyCon *)ptr->data; - RB_FLAG_SET(rbc->flag, value, RBC_FLAG_ENABLED); + SET_FLAG_FROM_TEST(rbc->flag, value, RBC_FLAG_ENABLED); # ifdef WITH_BULLET if (rbc->physics_constraint) { @@ -469,7 +461,7 @@ static void rna_RigidBodyCon_disable_collisions_set(PointerRNA *ptr, bool value) { RigidBodyCon *rbc = (RigidBodyCon *)ptr->data; - RB_FLAG_SET(rbc->flag, value, RBC_FLAG_DISABLE_COLLISIONS); + SET_FLAG_FROM_TEST(rbc->flag, value, RBC_FLAG_DISABLE_COLLISIONS); rbc->flag |= RBC_FLAG_NEEDS_VALIDATE; } @@ -728,7 +720,7 @@ static void rna_RigidBodyCon_use_motor_lin_set(PointerRNA *ptr, bool value) { RigidBodyCon *rbc = (RigidBodyCon *)ptr->data; - RB_FLAG_SET(rbc->flag, value, RBC_FLAG_USE_MOTOR_LIN); + SET_FLAG_FROM_TEST(rbc->flag, value, RBC_FLAG_USE_MOTOR_LIN); # ifdef WITH_BULLET if (rbc->physics_constraint) { @@ -743,7 +735,7 @@ static void rna_RigidBodyCon_use_motor_ang_set(PointerRNA *ptr, bool value) { RigidBodyCon *rbc = (RigidBodyCon *)ptr->data; - RB_FLAG_SET(rbc->flag, value, RBC_FLAG_USE_MOTOR_ANG); + SET_FLAG_FROM_TEST(rbc->flag, value, RBC_FLAG_USE_MOTOR_ANG); # ifdef WITH_BULLET if (rbc->physics_constraint) { |