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 1.30 by greg, Wed Oct 23 08:49:40 1991 UTC vs.
Revision 1.31 by greg, Fri Nov 8 16:34:27 1991 UTC

# Line 41 | Line 41 | markvirtuals()                 /* find and mark virtual sources */
41                  o = objptr(i);
42                  if (!issurface(o->otype) || o->omod == OVOID)
43                          continue;
44 <                if (!isvlight(objptr(o->omod)->otype))
44 >                if (!isvlight(vsmaterial(o)->otype))
45                          continue;
46                  if (sfun[o->otype].of == NULL ||
47                                  sfun[o->otype].of->getpleq == NULL) {
# Line 101 | Line 101 | int  n;
101          if (o == source[sn].so) /* objects cannot project themselves */
102                  return;
103                                  /* get virtual source material */
104 <        vsmat = sfun[objptr(o->omod)->otype].mf;
104 >        vsmat = sfun[vsmaterial(o)->otype].mf;
105                                  /* project virtual sources */
106          for (i = 0; i < vsmat->nproj; i++)
107                  if ((*vsmat->vproj)(proj, o, &source[sn], i))
# Line 112 | Line 112 | int  n;
112   #endif
113                                  addvirtuals(ns, n);
114                          }
115 + }
116 +
117 +
118 + OBJREC *
119 + vsmaterial(o)                   /* get virtual source material pointer */
120 + OBJREC  *o;
121 + {
122 +        register int  i;
123 +        register OBJREC  *m;
124 +
125 +        i = o->omod;
126 +        m = objptr(i);
127 +        if (m->otype != MAT_ILLUM || m->oargs.nsargs < 1 ||
128 +                        !strcmp(m->oargs.sarg[0], VOIDID) ||
129 +                        (i = modifier(m->oargs.sarg[0])) < 0)
130 +                return(m);              /* direct modifier */
131 +        return(objptr(i));              /* illum alternate */
132   }
133  
134  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines