1 |
– |
/* Copyright (c) 1998 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 cone output. |
6 |
|
*/ |
8 |
|
#include "standard.h" |
9 |
|
#include "rhd_qtree.h" |
10 |
|
|
11 |
+ |
static void redraw(RTREE *tp, int x0, int y0, int x1, int y1, int l[2][2]); |
12 |
+ |
static void cpaint(uby8 rgb[3], float *p, int x0, int y0, int x1, int y1); |
13 |
+ |
static void update(uby8 ca[3], RTREE *tp, int x0, int y0, int x1, int y1); |
14 |
|
|
15 |
< |
static |
16 |
< |
redraw(tp, x0, y0, x1, y1, l) /* mark portion of a tree for redraw */ |
17 |
< |
register RTREE *tp; |
18 |
< |
int x0, y0, x1, y1; |
19 |
< |
int l[2][2]; |
15 |
> |
|
16 |
> |
|
17 |
> |
static void |
18 |
> |
redraw( /* mark portion of a tree for redraw */ |
19 |
> |
register RTREE *tp, |
20 |
> |
int x0, |
21 |
> |
int y0, |
22 |
> |
int x1, |
23 |
> |
int y1, |
24 |
> |
int l[2][2] |
25 |
> |
) |
26 |
|
{ |
27 |
|
int quads = CH_ANY; |
28 |
|
int mx, my; |
48 |
|
} |
49 |
|
|
50 |
|
|
51 |
< |
static |
52 |
< |
cpaint(rgb, p, x0, y0, x1, y1) /* paint a cone within a rectangle */ |
53 |
< |
BYTE rgb[3]; |
54 |
< |
register float *p; |
55 |
< |
int x0, y0, x1, y1; |
51 |
> |
static void |
52 |
> |
cpaint( /* paint a cone within a rectangle */ |
53 |
> |
uby8 rgb[3], |
54 |
> |
register float *p, |
55 |
> |
int x0, |
56 |
> |
int y0, |
57 |
> |
int x1, |
58 |
> |
int y1 |
59 |
> |
) |
60 |
|
{ |
61 |
|
static FVECT ip, wp; |
62 |
|
double rad; |
93 |
|
} |
94 |
|
|
95 |
|
|
96 |
< |
static |
97 |
< |
update(ca, tp, x0, y0, x1, y1) /* update tree display as needed */ |
98 |
< |
BYTE ca[3]; /* returned average color */ |
99 |
< |
register RTREE *tp; |
100 |
< |
int x0, y0, x1, y1; |
96 |
> |
static void |
97 |
> |
update( /* update tree display as needed */ |
98 |
> |
uby8 ca[3], /* returned average color */ |
99 |
> |
register RTREE *tp, |
100 |
> |
int x0, |
101 |
> |
int y0, |
102 |
> |
int x1, |
103 |
> |
int y1 |
104 |
> |
) |
105 |
|
{ |
106 |
|
int csm[3], nc; |
107 |
< |
register BYTE *cp; |
108 |
< |
BYTE rgb[3]; |
107 |
> |
register uby8 *cp; |
108 |
> |
uby8 rgb[3]; |
109 |
|
int gaps = 0; |
110 |
|
int mx, my; |
111 |
|
register int i; |
149 |
|
} |
150 |
|
|
151 |
|
|
152 |
< |
qtRedraw(x0, y0, x1, y1) /* redraw part or all of our screen */ |
153 |
< |
int x0, y0, x1, y1; |
152 |
> |
extern void |
153 |
> |
qtRedraw( /* redraw part or all of our screen */ |
154 |
> |
int x0, |
155 |
> |
int y0, |
156 |
> |
int x1, |
157 |
> |
int y1 |
158 |
> |
) |
159 |
|
{ |
160 |
|
int lim[2][2]; |
161 |
|
|
162 |
|
if (is_stump(&qtrunk)) |
163 |
|
return; |
164 |
< |
if (!qtMapLeaves((lim[0][0]=x0) <= 0 & (lim[1][0]=y0) <= 0 & |
165 |
< |
(lim[0][1]=x1) >= odev.hres-1 & (lim[1][1]=y1) >= odev.vres-1)) |
164 |
> |
if (!(qtMapLeaves((lim[0][0]=x0) <= 0) & ((lim[1][0]=y0) <= 0) & |
165 |
> |
((lim[0][1]=x1) >= odev.hres-1) & ((lim[1][1]=y1) >= odev.vres-1))) |
166 |
|
return; |
167 |
|
redraw(&qtrunk, 0, 0, odev.hres, odev.vres, lim); |
168 |
|
} |
169 |
|
|
170 |
|
|
171 |
< |
qtUpdate() /* update our tree display */ |
171 |
> |
extern void |
172 |
> |
qtUpdate(void) /* update our tree display */ |
173 |
|
{ |
174 |
< |
BYTE ca[3]; |
174 |
> |
uby8 ca[3]; |
175 |
|
|
176 |
|
if (is_stump(&qtrunk)) |
177 |
|
return; |