--- ray/src/rt/srcsamp.c 2003/02/25 02:47:23 2.8 +++ ray/src/rt/srcsamp.c 2003/09/13 17:31:35 2.11 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: srcsamp.c,v 2.8 2003/02/25 02:47:23 greg Exp $"; +static const char RCSid[] = "$Id: srcsamp.c,v 2.11 2003/09/13 17:31:35 greg Exp $"; #endif /* * Source sampling routines @@ -114,12 +114,13 @@ unsigned char *pt; /* partition array */ /* check this partition */ p = spart(pt, pp[0]); pp[0]++; - if (p == S0) /* leaf partition */ + if (p == S0) { /* leaf partition */ if (pp[1]) { pp[1]--; return(0); /* not there yet */ } else return(1); /* we've arrived */ + } /* else check lower */ sz[p] >>= 1; ct[p] -= sz[p]; @@ -229,7 +230,7 @@ flatpart(si, r) /* partition a flat source */ register SRCINDEX *si; register RAY *r; { - register FLOAT *vp; + register RREAL *vp; FVECT v; double du2, dv2; int pi; @@ -240,7 +241,7 @@ register RAY *r; v[1] = r->rorg[1] - vp[1]; v[2] = r->rorg[2] - vp[2]; vp = source[si->sn].snorm; - if (DOT(v,vp) <= FTINY) { /* behind source */ + if (DOT(v,vp) <= 0.) { /* behind source */ si->np = 0; return; } @@ -313,7 +314,7 @@ scylform(sn, dir) /* compute cosine for cylinder's pr int sn; register FVECT dir; /* assume normalized */ { - register FLOAT *dv; + register RREAL *dv; double d; dv = source[sn].ss[SU];