| 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 |
|
|
| 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 */ |
| 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; |
| 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 |
|
|
| 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) |