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:
Diffstat (limited to 'source/blender/blenkernel/intern/effect.c')
-rw-r--r--source/blender/blenkernel/intern/effect.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 94b4af10201..0cbd7376e4f 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -1072,7 +1072,11 @@ static void debug_data_insert(SimDebugData *debug_data, SimDebugElement *elem)
void BKE_sim_debug_data_add_dot(struct SimDebugData *debug_data, const float p[3], float r, float g, float b, int hash)
{
- SimDebugElement *elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
+ SimDebugElement *elem;
+ if (!debug_data)
+ return;
+
+ elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
elem->type = SIM_DEBUG_ELEM_DOT;
elem->hash = hash;
elem->color[0] = r;
@@ -1085,7 +1089,11 @@ void BKE_sim_debug_data_add_dot(struct SimDebugData *debug_data, const float p[3
void BKE_sim_debug_data_add_line(struct SimDebugData *debug_data, const float p1[3], const float p2[3], float r, float g, float b, int hash)
{
- SimDebugElement *elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
+ SimDebugElement *elem;
+ if (!debug_data)
+ return;
+
+ elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
elem->type = SIM_DEBUG_ELEM_LINE;
elem->hash = hash;
elem->color[0] = r;
@@ -1099,7 +1107,11 @@ void BKE_sim_debug_data_add_line(struct SimDebugData *debug_data, const float p1
void BKE_sim_debug_data_add_vector(struct SimDebugData *debug_data, const float p[3], const float d[3], float r, float g, float b, int hash)
{
- SimDebugElement *elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
+ SimDebugElement *elem;
+ if (!debug_data)
+ return;
+
+ elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
elem->type = SIM_DEBUG_ELEM_VECTOR;
elem->hash = hash;
elem->color[0] = r;
@@ -1111,6 +1123,16 @@ void BKE_sim_debug_data_add_vector(struct SimDebugData *debug_data, const float
debug_data_insert(debug_data, elem);
}
+void BKE_sim_debug_data_remove(SimDebugData *debug_data, int hash)
+{
+ SimDebugElement dummy;
+ if (!debug_data)
+ return;
+
+ dummy.hash = hash;
+ BLI_ghash_remove(debug_data->gh, &dummy, NULL, debug_element_free);
+}
+
void BKE_sim_debug_data_clear(SimDebugData *debug_data)
{
if (!debug_data)