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.2 by greg, Thu Sep 6 23:32:41 1990 UTC vs.
Revision 1.4 by greg, Wed Sep 19 08:26:02 1990 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19   #include  "otypes.h"
20  
21 < #define  OSTSIZ         3037            /* object table size (a prime!) */
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  
# Line 182 | Line 184 | nonsurfinset(orig, nobjs)              /* check sets for non-surfa
184   int  orig, nobjs;
185   {
186          int  n;
185        OBJECT  *nonset;
187          register OBJECT  *os;
188 <        register OBJECT  i;
189 <                                                /* count non-surfaces */
189 <        n = 0;
190 <        for (i = orig; i < orig+nobjs; i++)
191 <                if (!issurface(objptr(i)->otype))
192 <                        n++;
193 <        if (n <= 0)
194 <                return(0);
195 <                                                /* allocate set */
196 <        if ((nonset = (OBJECT *)malloc((n+1)*sizeof(OBJECT))) == NULL)
197 <                return(0);              /* give up if we haven't enough mem */
198 <                                                /* fill set */
199 <        os = nonset;
200 <        *os = n;
201 <        for (i = orig; i < orig+nobjs; i++)
202 <                if (!issurface(objptr(i)->otype))
203 <                        *++os = i;
204 <                                                /* now check all sets */
188 >        register OBJECT  i, t;
189 >
190          for (n = 0; n < OSTSIZ; n++) {
191                  if ((os = ostable[n]) == NULL)
192                          continue;
193                  while ((i = *os++) > 0)
194                          while (i--) {
195 <                                if (*os >= nonset[1]
196 <                                                && *os <= nonset[nonset[0]]
197 <                                                && inset(nonset, *os))
198 <                                        goto done;
199 <                                os++;
195 >                                t = *os++;
196 >                                if (t >= orig && t < orig+nobjs) {
197 >                                        t = objptr(t)->otype;
198 >                                        if (!issurface(t))
199 >                                                return(1);
200 >                                }
201                          }
202          }
203 < done:
218 <        free((char *)nonset);
219 <        return(n < OSTSIZ);
203 >        return(0);
204   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines