--- ray/src/rt/rv3.c 1992/10/02 16:19:56 2.3 +++ ray/src/rt/rv3.c 1994/12/20 20:18:41 2.6 @@ -1,4 +1,4 @@ -/* Copyright (c) 1987 Regents of the University of California */ +/* Copyright (c) 1994 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -19,8 +19,12 @@ static char SCCSid[] = "$SunId$ LBL"; #include "random.h" #ifndef WFLUSH -#define WFLUSH 30 /* flush after this many rays */ +#ifdef SPEED +#define WFLUSH (5*SPEED) +#else +#define WFLUSH 100 /* flush after this many rays */ #endif +#endif #ifdef SMLFLT #define sscanvec(s,v) (sscanf(s,"%f %f %f",v,v+1,v+2)==3) @@ -99,8 +103,8 @@ double *mp; (*dev->comout)("Pick view center\n"); if ((*dev->getcur)(&x, &y) == ABORT) return(-1); - if (viewray(thisray.rorg, thisray.rdir, &ourview, - (x+.5)/hresolu, (y+.5)/vresolu) < 0) { + if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, + &ourview, (x+.5)/hresolu, (y+.5)/vresolu)) < -FTINY) { error(COMMAND, "not on image"); return(-1); } @@ -143,8 +147,8 @@ paint(p, xmin, ymin, xmax, ymax) /* compute and paint register PNODE *p; int xmin, ymin, xmax, ymax; { - extern long nrays; - static long lastflush = 0; + extern unsigned long nrays; + static unsigned long lastflush = 0; static RAY thisray; double h, v; @@ -158,8 +162,8 @@ int xmin, ymin, xmax, ymax; h = xmin + (xmax-xmin)*frandom(); v = ymin + (ymax-ymin)*frandom(); - if (viewray(thisray.rorg, thisray.rdir, &ourview, - h/hresolu, v/vresolu) < 0) { + if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview, + h/hresolu, v/vresolu)) < -FTINY) { setcolor(thisray.rcol, 0.0, 0.0, 0.0); } else { rayorigin(&thisray, NULL, PRIMARY, 1.0);