1 |
– |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Quadtree display support routines for rectangle output. |
6 |
|
*/ |
9 |
|
#include "rhd_qtree.h" |
10 |
|
|
11 |
|
|
12 |
< |
static |
13 |
< |
redraw(tp, x0, y0, x1, y1, l) /* mark portion of a tree for redraw */ |
14 |
< |
register RTREE *tp; |
15 |
< |
int x0, y0, x1, y1; |
16 |
< |
int l[2][2]; |
12 |
> |
static void redraw(RTREE *tp, int x0, int y0, int x1, int y1, int l[2][2]); |
13 |
> |
static void update( uby8 ca[3], RTREE *tp, int x0, int y0, int x1, int y1); |
14 |
> |
|
15 |
> |
|
16 |
> |
static void |
17 |
> |
redraw( /* mark portion of a tree for redraw */ |
18 |
> |
RTREE *tp, |
19 |
> |
int x0, |
20 |
> |
int y0, |
21 |
> |
int x1, |
22 |
> |
int y1, |
23 |
> |
int l[2][2] |
24 |
> |
) |
25 |
|
{ |
26 |
|
int quads = CH_ANY; |
27 |
|
int mx, my; |
28 |
< |
register int i; |
28 |
> |
int i; |
29 |
|
/* compute midpoint */ |
30 |
|
mx = (x0 + x1) >> 1; |
31 |
|
my = (y0 + y1) >> 1; |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
< |
static |
51 |
< |
update(ca, tp, x0, y0, x1, y1) /* update tree display as needed */ |
52 |
< |
BYTE ca[3]; /* returned average color */ |
53 |
< |
register RTREE *tp; |
54 |
< |
int x0, y0, x1, y1; |
50 |
> |
static void |
51 |
> |
update( /* update tree display as needed */ |
52 |
> |
uby8 ca[3], /* returned average color */ |
53 |
> |
RTREE *tp, |
54 |
> |
int x0, |
55 |
> |
int y0, |
56 |
> |
int x1, |
57 |
> |
int y1 |
58 |
> |
) |
59 |
|
{ |
60 |
|
int csm[3], nc; |
61 |
< |
register BYTE *cp; |
62 |
< |
BYTE rgb[3]; |
61 |
> |
uby8 *cp; |
62 |
> |
uby8 rgb[3]; |
63 |
|
double dpth2[4], d2; |
64 |
|
int gaps = 0; |
65 |
|
int mx, my; |
66 |
< |
register int i; |
66 |
> |
int i; |
67 |
|
/* compute leaf depths */ |
68 |
|
d2 = FHUGE*FHUGE; |
69 |
|
for (i = 0; i < 4; i++) |
70 |
|
if (tp->flgs & LFF(i)) { |
71 |
|
FVECT dv; |
72 |
< |
register float *wp = qtL.wp[tp->k[i].li]; |
72 |
> |
float *wp = qtL.wp[tp->k[i].li]; |
73 |
|
|
74 |
|
dv[0] = wp[0] - odev.v.vp[0]; |
75 |
|
dv[1] = wp[1] - odev.v.vp[1]; |
117 |
|
} |
118 |
|
|
119 |
|
|
120 |
< |
qtRedraw(x0, y0, x1, y1) /* redraw part or all of our screen */ |
121 |
< |
int x0, y0, x1, y1; |
120 |
> |
void |
121 |
> |
qtRedraw( /* redraw part or all of our screen */ |
122 |
> |
int x0, |
123 |
> |
int y0, |
124 |
> |
int x1, |
125 |
> |
int y1 |
126 |
> |
) |
127 |
|
{ |
128 |
|
int lim[2][2]; |
129 |
|
|
130 |
|
if (is_stump(&qtrunk)) |
131 |
|
return; |
132 |
< |
if (!qtMapLeaves((lim[0][0]=x0) <= 0 & (lim[1][0]=y0) <= 0 & |
133 |
< |
(lim[0][1]=x1) >= odev.hres-1 & (lim[1][1]=y1) >= odev.vres-1)) |
132 |
> |
if (!qtMapLeaves(((lim[0][0]=x0) <= 0) & ((lim[1][0]=y0) <= 0) & |
133 |
> |
((lim[0][1]=x1) >= odev.hres-1) & ((lim[1][1]=y1) >= odev.vres-1))) |
134 |
|
return; |
135 |
|
redraw(&qtrunk, 0, 0, odev.hres, odev.vres, lim); |
136 |
|
} |
137 |
|
|
138 |
|
|
139 |
< |
qtUpdate() /* update our tree display */ |
139 |
> |
void |
140 |
> |
qtUpdate(void) /* update our tree display */ |
141 |
|
{ |
142 |
< |
BYTE ca[3]; |
142 |
> |
uby8 ca[3]; |
143 |
|
|
144 |
|
if (is_stump(&qtrunk)) |
145 |
|
return; |