Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-07-10 12:57:01 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-07-10 13:00:58 +0300
commit0c8452ad99035fa560a1c19a3b4a404bdbbd9ae6 (patch)
treeabcb66f6c12e5f31d546a5b20a3f10ad9f769956 /source/blender/modifiers/intern/MOD_ocean.c
parentde55ae56ae5d871b5bc7fa6383c90ef89d66fcd1 (diff)
Ocean Modifier: removed duplicated code
Some code was copied with 'keep in sync with xxx' comments added to it.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_ocean.c')
-rw-r--r--source/blender/modifiers/intern/MOD_ocean.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index b4c028a44e3..5aafd9b1877 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -61,27 +61,6 @@ static void init_cache_data(Object *ob, struct OceanModifierData *omd)
omd->chop_amount, omd->foam_coverage, omd->foam_fade, omd->resolution);
}
-/* keep in sync with init_ocean_modifier_bake(), object_modifier.c */
-static void init_ocean_modifier(struct OceanModifierData *omd)
-{
- int do_heightfield, do_chop, do_normals, do_jacobian;
-
- if (!omd || !omd->ocean) return;
-
- do_heightfield = true;
- do_chop = (omd->chop_amount > 0);
- do_normals = (omd->flag & MOD_OCEAN_GENERATE_NORMALS);
- do_jacobian = (omd->flag & MOD_OCEAN_GENERATE_FOAM);
-
- BKE_ocean_free_data(omd->ocean);
- BKE_ocean_init(omd->ocean, omd->resolution * omd->resolution, omd->resolution * omd->resolution,
- omd->spatial_size, omd->spatial_size,
- omd->wind_velocity, omd->smallest_wave, 1.0, omd->wave_direction, omd->damp, omd->wave_alignment,
- omd->depth, omd->time,
- do_heightfield, do_chop, do_normals, do_jacobian,
- omd->seed);
-}
-
static void simulate_ocean_modifier(struct OceanModifierData *omd)
{
BKE_ocean_simulate(omd->ocean, omd->time, omd->wave_scale, omd->chop_amount);
@@ -131,7 +110,7 @@ static void initData(ModifierData *md)
omd->foamlayername[0] = '\0'; /* layer name empty by default */
omd->ocean = BKE_ocean_add();
- init_ocean_modifier(omd);
+ BKE_ocean_init_from_modifier(omd->ocean, omd);
simulate_ocean_modifier(omd);
#else /* WITH_OCEANSIM */
/* unused */
@@ -168,7 +147,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla
tomd->oceancache = NULL;
tomd->ocean = BKE_ocean_add();
- init_ocean_modifier(tomd);
+ BKE_ocean_init_from_modifier(tomd->ocean, tomd);
simulate_ocean_modifier(tomd);
#else /* WITH_OCEANSIM */
/* unused */