115 |
|
maxcntr = nsources + MAXSPART; /* start with this many */ |
116 |
|
srccnt = (CONTRIB *)malloc(maxcntr*sizeof(CONTRIB)); |
117 |
|
cntord = (CNTPTR *)malloc(maxcntr*sizeof(CNTPTR)); |
118 |
< |
if (srccnt == NULL | cntord == NULL) |
118 |
> |
if ((srccnt == NULL) | (cntord == NULL)) |
119 |
|
goto memerr; |
120 |
|
return; |
121 |
|
memerr: |
297 |
|
maxcntr*sizeof(CONTRIB)); |
298 |
|
cntord = (CNTPTR *)realloc((void *)cntord, |
299 |
|
maxcntr*sizeof(CNTPTR)); |
300 |
< |
if (srccnt == NULL | cntord == NULL) |
300 |
> |
if ((srccnt == NULL) | (cntord == NULL)) |
301 |
|
error(SYSTEM, "out of memory in direct"); |
302 |
|
} |
303 |
|
cntord[sn].sndx = sn; |
355 |
|
rayorigin(&sr, r, SHADOW, 1.0); |
356 |
|
VCOPY(sr.rdir, scp->dir); |
357 |
|
sr.rsrc = scp->sno; |
358 |
< |
source[scp->sno].ntests++; /* keep statistics */ |
358 |
> |
/* keep statistics */ |
359 |
> |
if (source[scp->sno].ntests++ > 0xfffffff0) { |
360 |
> |
source[scp->sno].ntests >>= 1; |
361 |
> |
source[scp->sno].nhits >>= 1; |
362 |
> |
} |
363 |
|
if (localhit(&sr, &thescene) && |
364 |
|
( sr.ro != source[scp->sno].so || |
365 |
|
source[scp->sno].sflags & SFOLLOW )) { |
493 |
|
|
494 |
|
static int weaksrcmod(obj) int obj; /* efficiency booster function */ |
495 |
|
{register OBJREC *o = objptr(obj); |
496 |
< |
return(o->otype==MAT_ILLUM|o->otype==MAT_GLOW);} |
496 |
> |
return((o->otype==MAT_ILLUM)|(o->otype==MAT_GLOW));} |
497 |
|
|
498 |
|
#define illumblock(m, r) (!(source[r->rsrc].sflags&SVIRTUAL) && \ |
499 |
|
r->rod > 0.0 && \ |