1 |
|
#ifndef lint |
2 |
< |
static const char RCSid[] = "$Id$"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
4 |
|
/* |
5 |
|
* source.c - routines dealing with illumination sources. |
54 |
|
/* initialize dispatch table */ |
55 |
|
initstypes(); |
56 |
|
/* find direct sources */ |
57 |
< |
for (i = 0; i < nobjects; i++) { |
57 |
> |
for (i = 0; i < nsceneobjs; i++) { |
58 |
|
|
59 |
|
o = objptr(i); |
60 |
|
|
250 |
|
for (i = 0; i < 3; i++) |
251 |
|
r->ron[i] = -r->rdir[i]; |
252 |
|
r->rod = 1.0; |
253 |
+ |
r->pert[0] = r->pert[1] = r->pert[2] = 0.0; |
254 |
+ |
r->uv[0] = r->uv[1] = 0.0; |
255 |
|
r->rox = NULL; |
256 |
|
return(1); |
257 |
|
} |
293 |
|
for (sn = 0; srcray(&sr, r, &si); sn++) { |
294 |
|
if (sn >= maxcntr) { |
295 |
|
maxcntr = sn + MAXSPART; |
296 |
< |
srccnt = (CONTRIB *)realloc((char *)srccnt, |
296 |
> |
srccnt = (CONTRIB *)realloc((void *)srccnt, |
297 |
|
maxcntr*sizeof(CONTRIB)); |
298 |
< |
cntord = (CNTPTR *)realloc((char *)cntord, |
298 |
> |
cntord = (CNTPTR *)realloc((void *)cntord, |
299 |
|
maxcntr*sizeof(CNTPTR)); |
300 |
|
if (srccnt == NULL | cntord == NULL) |
301 |
|
error(SYSTEM, "out of memory in direct"); |