--- ray/src/hd/rhd_qtree2r.c 2003/02/22 02:07:24 3.4 +++ ray/src/hd/rhd_qtree2r.c 2018/10/05 19:19:16 3.8 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rhd_qtree2r.c,v 3.4 2003/02/22 02:07:24 greg Exp $"; +static const char RCSid[] = "$Id: rhd_qtree2r.c,v 3.8 2018/10/05 19:19:16 greg Exp $"; #endif /* * Quadtree display support routines for rectangle output. @@ -9,15 +9,23 @@ static const char RCSid[] = "$Id: rhd_qtree2r.c,v 3.4 #include "rhd_qtree.h" -static -redraw(tp, x0, y0, x1, y1, l) /* mark portion of a tree for redraw */ -register RTREE *tp; -int x0, y0, x1, y1; -int l[2][2]; +static void redraw(RTREE *tp, int x0, int y0, int x1, int y1, int l[2][2]); +static void update( uby8 ca[3], RTREE *tp, int x0, int y0, int x1, int y1); + + +static void +redraw( /* mark portion of a tree for redraw */ + RTREE *tp, + int x0, + int y0, + int x1, + int y1, + int l[2][2] +) { int quads = CH_ANY; int mx, my; - register int i; + int i; /* compute midpoint */ mx = (x0 + x1) >> 1; my = (y0 + y1) >> 1; @@ -39,25 +47,29 @@ int l[2][2]; } -static -update(ca, tp, x0, y0, x1, y1) /* update tree display as needed */ -BYTE ca[3]; /* returned average color */ -register RTREE *tp; -int x0, y0, x1, y1; +static void +update( /* update tree display as needed */ + uby8 ca[3], /* returned average color */ + RTREE *tp, + int x0, + int y0, + int x1, + int y1 +) { int csm[3], nc; - register BYTE *cp; - BYTE rgb[3]; + uby8 *cp; + uby8 rgb[3]; double dpth2[4], d2; int gaps = 0; int mx, my; - register int i; + int i; /* compute leaf depths */ d2 = FHUGE*FHUGE; for (i = 0; i < 4; i++) if (tp->flgs & LFF(i)) { FVECT dv; - register float *wp = qtL.wp[tp->k[i].li]; + float *wp = qtL.wp[tp->k[i].li]; dv[0] = wp[0] - odev.v.vp[0]; dv[1] = wp[1] - odev.v.vp[1]; @@ -105,23 +117,29 @@ int x0, y0, x1, y1; } -qtRedraw(x0, y0, x1, y1) /* redraw part or all of our screen */ -int x0, y0, x1, y1; +void +qtRedraw( /* redraw part or all of our screen */ + int x0, + int y0, + int x1, + int y1 +) { int lim[2][2]; if (is_stump(&qtrunk)) return; - if (!qtMapLeaves((lim[0][0]=x0) <= 0 & (lim[1][0]=y0) <= 0 & - (lim[0][1]=x1) >= odev.hres-1 & (lim[1][1]=y1) >= odev.vres-1)) + if (!qtMapLeaves(((lim[0][0]=x0) <= 0) & ((lim[1][0]=y0) <= 0) & + ((lim[0][1]=x1) >= odev.hres-1) & ((lim[1][1]=y1) >= odev.vres-1))) return; redraw(&qtrunk, 0, 0, odev.hres, odev.vres, lim); } -qtUpdate() /* update our tree display */ +void +qtUpdate(void) /* update our tree display */ { - BYTE ca[3]; + uby8 ca[3]; if (is_stump(&qtrunk)) return;