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

Comparing ray/src/rt/virtuals.c (file contents):
Revision 2.9 by greg, Wed Apr 23 00:52:34 2003 UTC vs.
Revision 2.13 by greg, Tue Mar 2 01:13:45 2004 UTC

# Line 35 | Line 35 | markvirtuals()                 /* find and mark virtual sources */
35          if (directrelay <= 0)
36                  return;
37                                          /* find virtual source objects */
38 <        for (i = 0; i < nobjects; i++) {
38 >        for (i = 0; i < nsceneobjs; i++) {
39                  o = objptr(i);
40                  if (!issurface(o->otype) || o->omod == OVOID)
41                          continue;
# Line 123 | Line 123 | OBJREC  *o;
123          register OBJREC  *m;
124  
125          i = o->omod;
126 <        m = objptr(i);
126 >        m = findmaterial(objptr(i));
127 >        if (m == NULL)
128 >                return(objptr(i));
129          if (m->otype != MAT_ILLUM || m->oargs.nsargs < 1 ||
130                          !strcmp(m->oargs.sarg[0], VOIDID) ||
131                          (i = lastmod(objndx(m), m->oargs.sarg[0])) == OVOID)
# Line 194 | Line 196 | MAT4  pm;
196                  else
197                          nsflags &= ~SSPOT;
198                  if (source[sn].sflags & SSPOT) {
199 <                        copystruct(&theirspot, source[sn].sl.s);
199 >                        theirspot = *(source[sn].sl.s);
200                          multv3(theirspot.aim, source[sn].sl.s->aim, pm);
201                          normalize(theirspot.aim);
202                          if (nsflags & SSPOT) {
# Line 204 | Line 206 | MAT4  pm;
206                                          return(-1);     /* no overlap */
207                          } else {
208                                  nsflags |= SSPOT;
209 <                                copystruct(&ourspot, &theirspot);
209 >                                ourspot = theirspot;
210                                  d = 2.*ourspot.siz;
211                          }
212                          if (ourspot.siz < d-FTINY) {    /* it shrunk */
# Line 244 | Line 246 | MAT4  pm;
246          if (nsflags & SSPOT) {
247                  if ((source[i].sl.s = (SPOT *)malloc(sizeof(SPOT))) == NULL)
248                          goto memerr;
249 <                copystruct(source[i].sl.s, &ourspot);
249 >                *(source[i].sl.s) = ourspot;
250          }
251          if (nsflags & SPROX)
252                  source[i].sl.prox = source[sn].sl.prox;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines