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

Comparing ray/src/common/objset.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:34:37 1989 UTC vs.
Revision 1.7 by greg, Fri May 10 10:37:14 1991 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include  "object.h"
18  
19 < #define  OSTSIZ         3037            /* object table size (a prime!) */
19 > #include  "otypes.h"
20  
21 + #ifndef  OSTSIZ
22 + #define  OSTSIZ         12329           /* object table size (a prime!) */
23 + #endif
24 +
25   static OBJECT  *ostable[OSTSIZ];        /* the object set table */
26  
27  
# Line 42 | Line 46 | OBJECT  obj;
46   {
47          register int  i;
48  
49 <        for (i = (*os++)--; i > 0 && *os < obj; i--, os++)
50 <                ;
49 >        i = (*os)--;
50 >        os++;
51 >        while (i > 0 && *os < obj) {
52 >                i--;
53 >                os++;
54 >        }
55          while (--i > 0) {
56                  os[0] = os[1];
57                  os++;
# Line 173 | Line 181 | OCTREE  ot;
181          return;
182   noderr:
183          error(CONSISTENCY, "bad node in objset");
184 + }
185 +
186 +
187 + nonsurfinset(orig, nobjs)               /* check sets for non-surfaces */
188 + int  orig, nobjs;
189 + {
190 +        int  n;
191 +        register OBJECT  *os;
192 +        register OBJECT  i, s;
193 +
194 +        for (n = 0; n < OSTSIZ; n++) {
195 +                if ((os = ostable[n]) == NULL)
196 +                        continue;
197 +                while ((i = *os++) > 0)
198 +                        while (i--) {
199 +                                s = *os;
200 +                                if (s >= orig && s < orig+nobjs &&
201 +                                                !issurface(objptr(s)->otype))
202 +                                        return(1);
203 +                                os++;
204 +                        }
205 +        }
206 +        return(0);
207   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines