ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhd_qtree2r.c
(Generate patch)

Comparing ray/src/hd/rhd_qtree2r.c (file contents):
Revision 3.2 by gregl, Tue Nov 25 17:33:02 1997 UTC vs.
Revision 3.6 by schorsch, Thu Jan 1 11:21:55 2004 UTC

# Line 1 | Line 1
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   */
# Line 12 | Line 9 | static char SCCSid[] = "$SunId$ SGI";
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( BYTE 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 >        register 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;
# Line 26 | Line 31 | int    l[2][2];
31          my = (y0 + y1) >> 1;
32                                          /* see what to do */
33          if (l[0][0] > mx)
34 <                quads &= ~(CHF(2)|CHF(0));
34 >                quads &= ~(CHF(UL)|CHF(DL));
35          else if (l[0][1] < mx)
36 <                quads &= ~(CHF(3)|CHF(1));
36 >                quads &= ~(CHF(UR)|CHF(DR));
37          if (l[1][0] > my)
38 <                quads &= ~(CHF(1)|CHF(0));
38 >                quads &= ~(CHF(DR)|CHF(DL));
39          else if (l[1][1] < my)
40 <                quads &= ~(CHF(3)|CHF(2));
40 >                quads &= ~(CHF(UR)|CHF(UL));
41          tp->flgs |= quads;              /* mark quadrants for update */
42                                          /* climb the branches */
43          for (i = 0; i < 4; i++)
# Line 42 | Line 47 | int    l[2][2];
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 >        BYTE    ca[3],          /* returned average color */
53 >        register 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;
# Line 108 | Line 117 | int    x0, y0, x1, y1;
117   }
118  
119  
120 < qtRedraw(x0, y0, x1, y1)        /* redraw part or all of our screen */
121 < int     x0, y0, x1, y1;
120 > extern 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 > extern void
140 > qtUpdate(void)                  /* update our tree display */
141   {
142          BYTE    ca[3];
143  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines