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:
authorJiri Hnidek <jiri.hnidek@tul.cz>2007-04-20 16:56:51 +0400
committerJiri Hnidek <jiri.hnidek@tul.cz>2007-04-20 16:56:51 +0400
commit2857861023ac144274fd8b1f9f82777aac72462f (patch)
treec001d91f51b56b5e5b710bc14a082dcb67bcaa33 /source/blender/blenkernel/intern/mball.c
parent3fe793f2b5ceb3842a888de20e7baf2c90753c73 (diff)
Buf fix for #6571
- metaball_tree= NULL; was missing in code
Diffstat (limited to 'source/blender/blenkernel/intern/mball.c')
-rw-r--r--source/blender/blenkernel/intern/mball.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 2e1efed5b49..e731f0fdfe0 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -40,6 +40,7 @@
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
+#include <float.h>
#include "MEM_guardedalloc.h"
#include "DNA_material_types.h"
@@ -74,7 +75,7 @@
float thresh= 0.6f;
int totelem=0;
MetaElem **mainb;
-octal_tree *metaball_tree;
+octal_tree *metaball_tree = NULL;
/* Functions */
void unlink_mball(MetaBall *mb)
@@ -1918,7 +1919,7 @@ void free_metaball_octal_node(octal_node *node)
if(node->nodes[a]!=NULL) free_metaball_octal_node(node->nodes[a]);
}
BLI_freelistN(&node->elems);
- if(node) MEM_freeN(node);
+ MEM_freeN(node);
}
/* If scene include more then one MetaElem, then octree is used */
@@ -1944,8 +1945,8 @@ void init_metaball_octal_tree(int depth)
for(a=0;a<8;a++)
node->nodes[a]=NULL;
- node->x_min= node->y_min= node->z_min= 10000000.0;
- node->x_max= node->y_max= node->z_max= -10000000.0;
+ node->x_min= node->y_min= node->z_min= FLT_MAX;
+ node->x_max= node->y_max= node->z_max= -FLT_MAX;
/* size of octal tree scene */
for(a=0;a<totelem;a++) {
@@ -2008,6 +2009,7 @@ void metaball_polygonize(Object *ob)
if(metaball_tree){
free_metaball_octal_node(metaball_tree->first);
MEM_freeN(metaball_tree);
+ metaball_tree= NULL;
}
/* if scene includes more then one MetaElem, then octal tree optimalisation is used */