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

Comparing ray/src/rt/srcsupp.c (file contents):
Revision 2.10 by greg, Tue Feb 25 02:47:23 2003 UTC vs.
Revision 2.15 by greg, Sun Oct 16 16:04:10 2005 UTC

# Line 19 | Line 19 | static const char      RCSid[] = "$Id$";
19  
20   #include  "face.h"
21  
22 < #define SRCINC          4               /* realloc increment for array */
22 > #define SRCINC          8               /* realloc increment for array */
23  
24   SRCREC  *source = NULL;                 /* our list of sources */
25   int  nsources = 0;                      /* the number of sources */
# Line 54 | Line 54 | newsource()                    /* allocate new source in our array */
54          if (nsources == 0)
55                  source = (SRCREC *)malloc(SRCINC*sizeof(SRCREC));
56          else if (nsources%SRCINC == 0)
57 <                source = (SRCREC *)realloc((char *)source,
57 >                source = (SRCREC *)realloc((void *)source,
58                                  (unsigned)(nsources+SRCINC)*sizeof(SRCREC));
59          if (source == NULL)
60                  return(-1);
61          source[nsources].sflags = 0;
62          source[nsources].nhits = 1;
63 <        source[nsources].ntests = 2;    /* initial hit probability = 1/2 */
63 >        source[nsources].ntests = 2;    /* initial hit probability = 50% */
64 > #if SHADCACHE
65 >        source[nsources].obscache = NULL;
66 > #endif
67          return(nsources++);
68   }
69  
# Line 106 | Line 109 | OBJREC  *so;
109                  src->sloc[j] /= (double)f->nv;
110          }
111          if (!inface(src->sloc, f))
112 <                objerror(so, USER, "cannot hit center");
112 >                objerror(so, USER, "cannot hit center for source");
113          src->sflags |= SFLAT;
114          VCOPY(src->snorm, f->norm);
115          src->ss2 = f->area;
# Line 192 | Line 195 | OBJREC  *so;
195          co = getcone(so, 0);
196          VCOPY(src->sloc, CO_P0(co));
197          if (CO_R0(co) > 0.0)
198 <                objerror(so, USER, "cannot hit center");
198 >                objerror(so, USER, "cannot hit center for source");
199          src->sflags |= SFLAT;
200          VCOPY(src->snorm, co->ad);
201          src->srad = CO_R1(co);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines