--- ray/src/hd/rhdisp3.c 1998/11/05 13:58:37 3.11 +++ ray/src/hd/rhdisp3.c 2018/01/24 04:39:52 3.17 @@ -1,16 +1,12 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: rhdisp3.c,v 3.17 2018/01/24 04:39:52 greg Exp $"; #endif - /* * Holodeck beam support for display process */ #include "rholo.h" #include "rhdisp.h" -#include "view.h" struct cellist { GCOORD *cl; @@ -41,8 +37,7 @@ int bi; pf[i] = 0.5*(cp[0][i] + cp[2][i]); sf2 = 0.25*dist2(cp[0], cp[2]); /* compute half diagonal length */ for (i = 0; i < 4; i++) { /* compute visible quad */ - viewloc(ip[i], vp, cp[i]); - if (ip[i][2] < 0.) { + if (viewloc(ip[i], vp, cp[i]) <= 0) { af = 0; goto getback; } @@ -56,7 +51,7 @@ int bi; (ip[1][0]-ip[3][0])*(ip[2][1]-ip[3][1]); af *= af >= 0 ? 0.5 : -0.5; getback: - copystruct(&vrev, vp); /* compute reverse view */ + vrev = *vp; /* compute reverse view */ for (i = 0; i < 3; i++) { vrev.vdir[i] = -vp->vdir[i]; vrev.vup[i] = -vp->vup[i]; @@ -68,8 +63,7 @@ getback: pb[i] = 0.5*(cp[0][i] + cp[2][i]); sb2 = 0.25*dist2(cp[0], cp[2]); /* compute half diagonal length */ for (i = 0; i < 4; i++) { /* compute visible quad */ - viewloc(ip[i], &vrev, cp[i]); - if (ip[i][2] < 0.) { + if (viewloc(ip[i], &vrev, cp[i]) <= 0) { ab = 0; goto finish; } @@ -242,7 +236,7 @@ addcell(gcp, cl) /* add a cell to a list */ GCOORD *gcp; register struct cellist *cl; { - copystruct(cl->cl+cl->n, gcp); + *(cl->cl+cl->n) = *gcp; cl->n++; return(1); } @@ -286,7 +280,7 @@ VIEW *vp; cl.n = 0; /* add cells within pyramid */ visit_cells(org, dir, hp, addcell, (char *)&cl); if (!cl.n) { - free((char *)cl.cl); + free((void *)cl.cl); return(NULL); } *np = cl.n * orient; @@ -295,7 +289,7 @@ VIEW *vp; * sorted automatically by visit_cells(), so we don't need this. */ /* optimize memory use */ - cl.cl = (GCOORD *)realloc((char *)cl.cl, cl.n*sizeof(GCOORD)); + cl.cl = (GCOORD *)realloc((void *)cl.cl, cl.n*sizeof(GCOORD)); if (cl.cl == NULL) goto memerr; /* sort the list */ @@ -307,8 +301,10 @@ memerr: } -gridlines(f) /* run through holodeck section grid lines */ -int (*f)(); +extern void +gridlines( /* run through holodeck section grid lines */ + void (*f)(FVECT wp[2]) +) { register int hd, w, i; int g0, g1;