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

Comparing ray/src/common/readoct.c (file contents):
Revision 2.11 by greg, Mon Aug 29 14:20:37 1994 UTC vs.
Revision 2.12 by greg, Fri Mar 7 15:45:26 1997 UTC

# Line 21 | Line 21 | static char SCCSid[] = "$SunId$ LBL";
21   static double  ogetflt();
22   static long  ogetint();
23   static char  *ogetstr();
24 + static int  nonsurfinset();
25   static int  getobj(), octerror(), skiptree();
26   static OCTREE  getfullnode(), gettree();
27  
# Line 28 | Line 29 | static char  *infn;                    /* input file name */
29   static FILE  *infp;                     /* input file stream */
30   static int  objsize;                    /* size of stored OBJECT's */
31   static OBJECT  objorig;                 /* zeroeth object */
32 + static OBJECT  fnobjects;               /* number of objects in this file */
33   static short  otypmap[NUMOTYPE+8];      /* object type map */
34  
35  
# Line 40 | Line 42 | char  *ofn[];
42   {
43          char  sbuf[512];
44          int  nf;
43        OBJECT  fnobjects;
45          register int  i;
46          long  m;
47          
# Line 109 | Line 110 | char  *ofn[];
110                  if (nobjects != objorig+fnobjects)
111                          octerror(USER, "bad object count; octree stale?");
112                                  /* check for non-surfaces */
113 <                if (nonsurfinset(objorig, fnobjects))
113 >                if (dosets(nonsurfinset))
114                          octerror(USER, "modifier in tree; octree stale?");
115              }
116          fclose(infp);
# Line 196 | Line 197 | gettree()                      /* get a pre-ordered octree */
197          default:
198                  octerror(USER, "damaged octree");
199          }
200 + }
201 +
202 +
203 + static int
204 + nonsurfinset(os)                        /* check set for modifier */
205 + register OBJECT  *os;
206 + {
207 +        register OBJECT  s;
208 +        register int  i;
209 +
210 +        for (i = *os; i-- > 0; )
211 +                if ((s = *++os) >= objorig && s < objorig+fnobjects &&
212 +                                ismodifier(objptr(s)->otype))
213 +                        return(1);
214 +        return(0);
215   }
216  
217  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines