~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/intern/mball.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 *  
7
7
 * texture coordinates are patched within the displist
8
8
 * 
9
 
 * $Id: mball.c,v 1.30 2006/11/20 21:25:01 ton Exp $
 
9
 * $Id: mball.c,v 1.32 2007/04/20 12:56:51 jiri Exp $
10
10
 *
11
11
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
12
12
 *
40
40
#include <math.h>
41
41
#include <stdlib.h>
42
42
#include <ctype.h>
 
43
#include <float.h>
43
44
#include "MEM_guardedalloc.h"
44
45
 
45
46
#include "DNA_material_types.h"
74
75
float thresh= 0.6f;
75
76
int totelem=0;
76
77
MetaElem **mainb;
77
 
octal_tree *metaball_tree;
 
78
octal_tree *metaball_tree = NULL;
78
79
/* Functions */
79
80
 
80
81
void unlink_mball(MetaBall *mb)
99
100
        if(mb->disp.first) freedisplist(&mb->disp);
100
101
}
101
102
 
102
 
MetaBall *add_mball()
 
103
MetaBall *add_mball(char *name)
103
104
{
104
105
        MetaBall *mb;
105
106
        
106
 
        mb= alloc_libblock(&G.main->mball, ID_MB, "Meta");
 
107
        mb= alloc_libblock(&G.main->mball, ID_MB, name);
107
108
        
108
109
        mb->size[0]= mb->size[1]= mb->size[2]= 1.0;
109
110
        mb->texflag= MB_AUTOSPACE;
1918
1919
                if(node->nodes[a]!=NULL) free_metaball_octal_node(node->nodes[a]);
1919
1920
        }
1920
1921
        BLI_freelistN(&node->elems);
1921
 
        if(node) MEM_freeN(node);
 
1922
        MEM_freeN(node);
1922
1923
}
1923
1924
 
1924
1925
/* If scene include more then one MetaElem, then octree is used */
1944
1945
        for(a=0;a<8;a++)
1945
1946
                node->nodes[a]=NULL;
1946
1947
 
1947
 
        node->x_min= node->y_min= node->z_min= 10000000.0;
1948
 
        node->x_max= node->y_max= node->z_max= -10000000.0;
 
1948
        node->x_min= node->y_min= node->z_min= FLT_MAX;
 
1949
        node->x_max= node->y_max= node->z_max= -FLT_MAX;
1949
1950
 
1950
1951
        /* size of octal tree scene */
1951
1952
        for(a=0;a<totelem;a++) {
2008
2009
        if(metaball_tree){
2009
2010
                free_metaball_octal_node(metaball_tree->first);
2010
2011
                MEM_freeN(metaball_tree);
 
2012
                metaball_tree= NULL;
2011
2013
        }
2012
2014
 
2013
2015
        /* if scene includes more then one MetaElem, then octal tree optimalisation is used */