diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-08-15 16:59:38 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-08-15 16:59:38 +0300 |
commit | 77497175fa1f2f3aacf4ab966df9d7223d4034cc (patch) | |
tree | 34e143b88d2f9857e6926a1d156b8d8c3243d7b2 /source/blender/editors/physics | |
parent | 90d80ddaa28908048e428fd08c4c771c015a0d66 (diff) |
Cleanup/refactor: no new general arg-less macros enforcing var names please!
We do have an history of those pieces of evil in our code, would be nice
to get fully rid of it, but at the very least let's not add more of them
in new code. :)
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 14 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_fluid.c | 4 | ||||
-rw-r--r-- | source/blender/editors/physics/rigidbody_constraint.c | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index d935915e1c9..1838c0fba5f 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4438,7 +4438,7 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo) void PE_undo_push(Scene *scene, SceneLayer *sl, const char *str) { - PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW); + PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl)); PTCacheUndo *undo; int nr; @@ -4480,7 +4480,7 @@ void PE_undo_push(Scene *scene, SceneLayer *sl, const char *str) void PE_undo_step(Scene *scene, SceneLayer *sl, int step) { - PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW); + PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl)); if (!edit) return; @@ -4511,12 +4511,12 @@ void PE_undo_step(Scene *scene, SceneLayer *sl, int step) } } - DEG_id_tag_update(&OBACT_NEW->id, OB_RECALC_DATA); + DEG_id_tag_update(&OBACT_NEW(sl)->id, OB_RECALC_DATA); } bool PE_undo_is_valid(Scene *scene, SceneLayer *sl) { - PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW); + PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl)); if (edit) { return (edit->undo.last != edit->undo.first); @@ -4551,7 +4551,7 @@ void PE_redo(Scene *scene, SceneLayer *sl) void PE_undo_number(Scene *scene, SceneLayer *sl, int nr) { - PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW); + PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl)); PTCacheUndo *undo; int a=0; @@ -4567,7 +4567,7 @@ void PE_undo_number(Scene *scene, SceneLayer *sl, int nr) /* if active pointer, set it to 1 if true */ const char *PE_undo_get_name(Scene *scene, SceneLayer *sl, int nr, bool *r_active) { - PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW); + PTCacheEdit *edit= PE_get_current(scene, sl, OBACT_NEW(sl)); PTCacheUndo *undo; if (r_active) *r_active = false; @@ -4588,7 +4588,7 @@ const char *PE_undo_get_name(Scene *scene, SceneLayer *sl, int nr, bool *r_activ int PE_minmax(Scene *scene, SceneLayer *sl, float min[3], float max[3]) { - Object *ob= OBACT_NEW; + Object *ob= OBACT_NEW(sl); PTCacheEdit *edit= PE_get_current(scene, sl, ob); ParticleSystem *psys; ParticleSystemModifierData *psmd = NULL; diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 9cd571c68cf..b38b8640c8d 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -349,7 +349,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid channels->DomainTime = MEM_callocN(length * (CHANNEL_FLOAT+1) * sizeof(float), "channel DomainTime"); /* allocate fluid objects */ - for (base = FIRSTBASE_NEW; base; base = base->next) { + for (base = FIRSTBASE_NEW(sl); base; base = base->next) { Object *ob = base->object; FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim); @@ -586,7 +586,7 @@ static int fluid_validate_scene(ReportList *reports, SceneLayer *sl, Object *fsD int channelObjCount = 0; int fluidInputCount = 0; - for (base = FIRSTBASE_NEW; base; base = base->next) { + for (base = FIRSTBASE_NEW(sl); base; base = base->next) { Object *ob = base->object; FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim); diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c index d93eb95243e..1c9b59268e4 100644 --- a/source/blender/editors/physics/rigidbody_constraint.c +++ b/source/blender/editors/physics/rigidbody_constraint.c @@ -121,7 +121,7 @@ static int rigidbody_con_add_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); SceneLayer *sl = CTX_data_scene_layer(C); RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); int type = RNA_enum_get(op->ptr, "type"); bool changed; @@ -170,7 +170,7 @@ static int rigidbody_con_remove_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); /* apply to active object */ if (ELEM(NULL, ob, ob->rigidbody_constraint)) { |