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

Comparing ray/src/rt/source.c (file contents):
Revision 2.14 by greg, Wed Jan 12 21:25:59 1994 UTC vs.
Revision 2.15 by greg, Thu Jan 13 10:43:36 1994 UTC

# Line 152 | Line 152 | SRCINDEX  *si;                 /* source sample index */
152  
153  
154   srcvalue(r)                     /* punch ray to source and compute value */
155 < RAY  *r;
155 > register RAY  *r;
156   {
157          register SRCREC  *sp;
158  
# Line 161 | Line 161 | RAY  *r;
161                                          /* check intersection */
162                  if (!(*ofun[sp->so->otype].funp)(sp->so, r))
163                          return;
164 <                raycont(r);             /* compute contribution */
164 >                if (!rayshade(r, r->ro->omod))  /* compute contribution */
165 >                        goto nomat;
166                  return;
167          }
168                                          /* compute intersection */
# Line 169 | Line 170 | RAY  *r;
170                          (*ofun[sp->so->otype].funp)(sp->so, r)) {
171                  if (sp->sa.success >= 0)
172                          sp->sa.success++;
173 <                raycont(r);             /* compute contribution */
173 >                if (!rayshade(r, r->ro->omod))  /* compute contribution */
174 >                        goto nomat;
175                  return;
176          }
177 +                                        /* we missed our mark! */
178          if (sp->sa.success < 0)
179                  return;                 /* bitched already */
180          sp->sa.success -= AIMREQT;
# Line 180 | Line 183 | RAY  *r;
183          sprintf(errmsg, "aiming failure for light source \"%s\"",
184                          sp->so->oname);
185          error(WARNING, errmsg);         /* issue warning */
186 +        return;
187 + nomat:
188 +        objerror(r->ro, USER, "material not found");
189   }
190  
191  
# Line 318 | Line 324 | char  *p;                      /* data for f */
324                                  ( sr.ro != source[scp->sno].so ||
325                                  source[scp->sno].sflags & SFOLLOW )) {
326                                                  /* follow entire path */
327 <                        raycont(&sr);
327 >                        if (!raycont(&sr))
328 >                                objerror(sr.ro, USER, "material not found");
329                          if (trace != NULL)
330                                  (*trace)(&sr);  /* trace execution */
331                          if (bright(sr.rcol) <= FTINY)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines