--- ray/src/hd/rhdisp2.c 1997/12/09 13:53:21 3.11 +++ ray/src/hd/rhdisp2.c 1997/12/15 20:40:46 3.15 @@ -13,7 +13,7 @@ static char SCCSid[] = "$SunId$ SGI"; #include "rhdriver.h" #ifndef MAXDIST -#define MAXDIST 13 /* maximum distance outside section */ +#define MAXDIST 42 /* maximum distance outside section */ #endif extern GCOORD *getviewcells(); @@ -94,6 +94,8 @@ register struct beamcomp *cb1, *cb2; if (!cb1->wants) /* put orphans at the end, unsorted */ return(cb2->wants); + if (!cb2->wants) + return(-1); if ((c = cb1->bi - cb2->bi)) /* sort on beam index first */ return(c); return(cb1->hd - cb2->hd); /* use hd to resolve matches */ @@ -375,14 +377,14 @@ register struct cellact *cap; axmax = -1; avmax = 0; for (i = 3; i--; ) { d = vgp[i] - cgp[i]; - if (d < 0) d = -d; + if (d < 0.) d = -d; if (d > avmax) { avmax = d; axmax = i; } } #ifdef DEBUG - if (axmax < 0) + if (axmax < 0.) error(CONSISTENCY, "botched axis computation in docell"); #endif /* compute offset vectors */ @@ -390,7 +392,7 @@ register struct cellact *cap; for (i = 3; i--; ) v1[i] = hp->xv[j][i] * d; d = 0.5/hp->grid[j=(axmax+2)%3]; - if (DOT(hp->wn[axmax], vc) < 0) + if (DOT(hp->wn[axmax], vc) < 0.) d = -d; /* reverse vertex ordering */ for (i = 3; i--; ) v2[i] = hp->xv[j][i] * d; @@ -469,9 +471,11 @@ VIEW *vold, *vnew; } +int beam_sync() /* synchronize beams on server */ { cbeamop(DR_NEWSET, cbeam, ncbeams, &odev.v, odev.hres, odev.vres); + return(ncbeams); } @@ -482,11 +486,11 @@ VIEW *vn; VOXL vlnew[8]; int n, comn; - if (!vn->type) { /* clear our beam list */ + if (vn == NULL || !vn->type) { /* clear our beam list */ set_voxels(vlnew, 0); cbeamop(DR_DELSET, cbeam, ncbeams, NULL, 0, 0); ncbeams = 0; - copystruct(&dvw, vn); + dvw.type = 0; return(1); } /* find our new voxels */