diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-11 13:14:18 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-11 13:15:14 +0300 |
commit | d0956e9cb3077971a9ae6c1ba9560604d5ad1ef7 (patch) | |
tree | 0dea964abf85748db7ab15a2feee1a41bf6ec52c /source/blender/blenkernel/intern/smoke.c | |
parent | 8055ed2741d1da48f2bf84c75ccb37b54cef1ab8 (diff) |
Cleanup: Moar G.main removal of Hell.
This commit actually adds some G.main... but at much, much higher level
than the ones it removes, so should still be better ;)
Diffstat (limited to 'source/blender/blenkernel/intern/smoke.c')
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 41ee8a4c7e8..2ab892a0233 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -2106,7 +2106,8 @@ BLI_INLINE void apply_inflow_fields(SmokeFlowSettings *sfs, float emission_value } } -static void update_flowsfluids(EvaluationContext *eval_ctx, Scene *scene, Object *ob, SmokeDomainSettings *sds, float dt) +static void update_flowsfluids( + Main *bmain, EvaluationContext *eval_ctx, Scene *scene, Object *ob, SmokeDomainSettings *sds, float dt) { Object **flowobjs = NULL; EmissionMap *emaps = NULL; @@ -2213,7 +2214,9 @@ static void update_flowsfluids(EvaluationContext *eval_ctx, Scene *scene, Object else { /* MOD_SMOKE_FLOW_SOURCE_MESH */ /* update flow object frame */ BLI_mutex_lock(&object_update_lock); - BKE_object_modifier_update_subframe(eval_ctx, scene, collob, true, 5, BKE_scene_frame_get(scene), eModifierType_Smoke); + BKE_object_modifier_update_subframe( + bmain, eval_ctx, scene, collob, + true, 5, BKE_scene_frame_get(scene), eModifierType_Smoke); BLI_mutex_unlock(&object_update_lock); /* apply flow */ @@ -2561,7 +2564,8 @@ static void update_effectors(Scene *scene, Object *ob, SmokeDomainSettings *sds, } static void step( - EvaluationContext *eval_ctx, Scene *scene, Object *ob, SmokeModifierData *smd, DerivedMesh *domain_dm, float fps) + Main *bmain, EvaluationContext *eval_ctx, + Scene *scene, Object *ob, SmokeModifierData *smd, DerivedMesh *domain_dm, float fps) { SmokeDomainSettings *sds = smd->domain; /* stability values copied from wturbulence.cpp */ @@ -2631,7 +2635,7 @@ static void step( for (substep = 0; substep < totalSubsteps; substep++) { // calc animated obstacle velocities - update_flowsfluids(eval_ctx, scene, ob, sds, dtSubdiv); + update_flowsfluids(bmain, eval_ctx, scene, ob, sds, dtSubdiv); update_obstacles(scene, ob, sds, dtSubdiv, substep, totalSubsteps); if (sds->total_cells > 1) { @@ -2728,7 +2732,8 @@ static DerivedMesh *createDomainGeometry(SmokeDomainSettings *sds, Object *ob) return result; } -static void smokeModifier_process(EvaluationContext *eval_ctx, SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm) +static void smokeModifier_process( + Main *bmain, EvaluationContext *eval_ctx, SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm) { if ((smd->type & MOD_SMOKE_TYPE_FLOW)) { @@ -2849,7 +2854,7 @@ static void smokeModifier_process(EvaluationContext *eval_ctx, SmokeModifierData } - step(eval_ctx, scene, ob, smd, dm, scene->r.frs_sec / scene->r.frs_sec_base); + step(bmain, eval_ctx, scene, ob, smd, dm, scene->r.frs_sec / scene->r.frs_sec_base); } // create shadows before writing cache so they get stored @@ -2877,7 +2882,7 @@ struct DerivedMesh *smokeModifier_do(SmokeModifierData *smd, Scene *scene, Objec BLI_rw_mutex_lock(smd->domain->fluid_mutex, THREAD_LOCK_WRITE); /* Ugly G.main, hopefully won't be needed anymore in 2.8 */ - smokeModifier_process(G.main->eval_ctx , smd, scene, ob, dm); + smokeModifier_process(G.main, G.main->eval_ctx , smd, scene, ob, dm); if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) BLI_rw_mutex_unlock(smd->domain->fluid_mutex); |