From 12ce0cfb21d83b70183a64de47ad05b5775b4937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 6 Jul 2018 12:42:58 +0200 Subject: Ocean Modifier: removed unused refresh flags The flags were set and cleared correctly, but nothing was actually reading them. --- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/makesdna/DNA_modifier_types.h | 4 ++-- source/blender/makesrna/intern/rna_modifier.c | 32 ++++++--------------------- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a03016c2536..4e845b9a60d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5364,7 +5364,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) OceanModifierData *omd = (OceanModifierData *)md; omd->oceancache = NULL; omd->ocean = BKE_ocean_add(); - omd->refresh = MOD_OCEAN_REFRESH_RESET | MOD_OCEAN_REFRESH_SIM; + omd->refresh = MOD_OCEAN_REFRESH_RESET; } else if (md->type == eModifierType_Warp) { WarpModifierData *tmd = (WarpModifierData *)md; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index f7fb3e0e376..00ae9ff8b60 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -1009,10 +1009,10 @@ enum { enum { MOD_OCEAN_REFRESH_RESET = (1 << 0), - MOD_OCEAN_REFRESH_SIM = (1 << 1), + /* MOD_OCEAN_REFRESH_SIM = (1 << 1), */ /* MOD_OCEAN_REFRESH_ADD = (1 << 2), */ MOD_OCEAN_REFRESH_CLEAR_CACHE = (1 << 3), - MOD_OCEAN_REFRESH_TOPOLOGY = (1 << 4), + /* MOD_OCEAN_REFRESH_TOPOLOGY = (1 << 4), */ }; enum { diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 902074d8628..1a05b6e5e00 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -737,25 +737,7 @@ static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA { OceanModifierData *omd = (OceanModifierData *)ptr->data; - omd->refresh |= (MOD_OCEAN_REFRESH_RESET | MOD_OCEAN_REFRESH_SIM | MOD_OCEAN_REFRESH_CLEAR_CACHE); - - rna_Modifier_update(bmain, scene, ptr); -} - -static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - OceanModifierData *omd = (OceanModifierData *)ptr->data; - - omd->refresh |= MOD_OCEAN_REFRESH_SIM; - - rna_Modifier_update(bmain, scene, ptr); -} - -static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - OceanModifierData *omd = (OceanModifierData *)ptr->data; - - omd->refresh |= MOD_OCEAN_REFRESH_TOPOLOGY; + omd->refresh |= MOD_OCEAN_REFRESH_RESET | MOD_OCEAN_REFRESH_CLEAR_CACHE; rna_Modifier_update(bmain, scene, ptr); } @@ -4070,7 +4052,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Size", "Surface scale factor (does not affect the height of the waves)"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, -1); - RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "repeat_x", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "repeat_x"); @@ -4078,7 +4060,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_range(prop, 1, 1024); RNA_def_property_ui_range(prop, 1, 100, 1, -1); RNA_def_property_ui_text(prop, "Repeat X", "Repetitions of the generated surface in X"); - RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "repeat_y", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "repeat_y"); @@ -4086,7 +4068,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_range(prop, 1, 1024); RNA_def_property_ui_range(prop, 1, 100, 1, -1); RNA_def_property_ui_text(prop, "Repeat Y", "Repetitions of the generated surface in Y"); - RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "use_normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_NORMALS); @@ -4150,7 +4132,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) prop = RNA_def_property(srna, "wave_scale", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "wave_scale"); RNA_def_property_ui_text(prop, "Wave Scale", "Scale of the displacement effect"); - RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "depth"); @@ -4182,13 +4164,13 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) "Choppiness of the wave's crest (adds some horizontal component to the displacement)"); RNA_def_property_ui_range(prop, 0.0, 4.0, 3, -1); RNA_def_property_float_funcs(prop, NULL, "rna_OceanModifier_ocean_chop_set", NULL); - RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "time"); RNA_def_property_ui_text(prop, "Time", "Current time of the simulation"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, -1); - RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "random_seed", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "seed"); -- cgit v1.2.3