ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/octree.c
(Generate patch)

Comparing ray/src/common/octree.c (file contents):
Revision 2.1 by greg, Tue Nov 12 16:55:14 1991 UTC vs.
Revision 2.6 by greg, Tue Feb 25 02:47:21 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1986 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  octree.c - routines dealing with octrees and cubes.
9 *
10 *     7/28/85
6   */
7  
8 + #include "copyright.h"
9 +
10   #include  "standard.h"
11  
12   #include  "octree.h"
# Line 33 | Line 30 | octalloc()                     /* allocate an octree */
30                  errno = 0;
31                  if (octbi(freet) >= MAXOBLK)
32                          return(EMPTY);
33 <                if ((octblock[octbi(freet)] = (OCTREE *)bmalloc(
34 <                                (unsigned)256*8*sizeof(OCTREE))) == NULL)
33 >                if ((octblock[octbi(freet)] = (OCTREE *)malloc(
34 >                                (unsigned)OCTBLKSIZ*8*sizeof(OCTREE))) == NULL)
35                          return(EMPTY);
36          }
37          treetop += 8;
# Line 42 | Line 39 | octalloc()                     /* allocate an octree */
39   }
40  
41  
42 + void
43   octfree(ot)                     /* free an octree */
44   register OCTREE  ot;
45   {
# Line 56 | Line 54 | register OCTREE  ot;
54   }
55  
56  
57 + void
58 + octdone()                       /* free EVERYTHING */
59 + {
60 +        register int    i;
61 +
62 +        for (i = 0; i < MAXOBLK; i++) {
63 +                if (octblock[i] == NULL)
64 +                        break;
65 +                free((void *)octblock[i]);
66 +                octblock[i] = NULL;
67 +        }
68 +        ofreelist = EMPTY;
69 +        treetop = 0;
70 + }
71 +
72 +
73   OCTREE
74   combine(ot)                     /* recursively combine nodes */
75   register OCTREE  ot;
# Line 77 | Line 91 | register OCTREE  ot;
91   }
92  
93  
94 + void
95   culocate(cu, pt)                /* locate point within cube */
96   register CUBE  *cu;
97   register FVECT  pt;
# Line 97 | Line 112 | register FVECT  pt;
112   }
113  
114  
115 + void
116   cucopy(cu1, cu2)                /* copy cu2 into cu1 */
117   register CUBE  *cu1, *cu2;
118   {
# Line 106 | Line 122 | register CUBE  *cu1, *cu2;
122   }
123  
124  
125 + int
126   incube(cu, pt)                  /* determine if a point is inside a cube */
127   register CUBE  *cu;
128   register FVECT  pt;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines