--- ray/src/hd/rhdisp2.c 1997/12/08 19:03:01 3.10 +++ ray/src/hd/rhdisp2.c 1997/12/12 12:30:20 3.14 @@ -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(); @@ -367,7 +367,7 @@ register struct cellact *cap; hdworld(org, hp, cgp); /* compute direction to voxel center */ for (i = 3; i--; ) - vgp[i] = voxel[cap->vi].i[i] + 0.5; + vgp[i] = voxel[cap->vi].i[i] + .5; hdworld(vc, hp, vgp); for (i = 3; i--; ) vc[i] -= org[i]; @@ -375,14 +375,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 +390,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; @@ -440,7 +440,6 @@ VIEW *vold, *vnew; ngcp = ngcl = getviewcells(&ncnt, hdlist[voxel[voxi].hd], vnew); /* set up actions */ oca.vi = nca.vi = voxi; - oca.rev = nca.rev = 0; oca.add = 0; nca.add = 1; if ((oca.rev = ocnt < 0)) ocnt = -ocnt; @@ -470,9 +469,11 @@ VIEW *vold, *vnew; } +int beam_sync() /* synchronize beams on server */ { cbeamop(DR_NEWSET, cbeam, ncbeams, &odev.v, odev.hres, odev.vres); + return(ncbeams); } @@ -483,11 +484,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 */