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

Comparing ray/src/rt/ambient.c (file contents):
Revision 1.10 by greg, Tue Jun 26 09:00:07 1990 UTC vs.
Revision 1.11 by greg, Fri Sep 7 08:17:42 1990 UTC

# Line 34 | Line 34 | extern int  ambounce;          /* number of ambient bounces */
34   extern char  *amblist[];        /* ambient include/exclude list */
35   extern int  ambincl;            /* include == 1, exclude == 0 */
36  
37 < OBJECT  ambset[256]={0};        /* ambient include/exclude set */
37 > #define  MAXASET        511     /* maximum number of elements in ambient set */
38 > OBJECT  ambset[MAXASET+1]={0};  /* ambient include/exclude set */
39  
40   double  maxarad;                /* maximum ambient radius */
41   double  minarad;                /* minimum ambient radius */
# Line 101 | Line 102 | char  *afile;
102   ambnotify(obj)                  /* record new modifier */
103   OBJECT  obj;
104   {
105 +        static int  hitlimit = 0;
106          register OBJREC  *o = objptr(obj);
107          register char  **amblp;
108  
109 <        if (!ismodifier(o->otype))
109 >        if (hitlimit || !ismodifier(o->otype))
110                  return;
111          for (amblp = amblist; *amblp != NULL; amblp++)
112                  if (!strcmp(o->oname, *amblp)) {
113 +                        if (ambset[0] >= MAXASET) {
114 +                                error(WARNING, "too many modifiers in ambient list");
115 +                                hitlimit++;
116 +                                return;         /* should this be fatal? */
117 +                        }
118                          insertelem(ambset, obj);
119                          return;
120                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines