1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
< |
|
3 |
< |
/* SCCSid "$SunId$ SGI" */ |
4 |
< |
|
1 |
> |
/* RCSid $Id$ */ |
2 |
|
/* |
3 |
|
* Quadtree data structures for holodeck display drivers. |
4 |
|
*/ |
5 |
+ |
#ifndef _RAD_RHD_QTREE_H_ |
6 |
+ |
#define _RAD_RHD_QTREE_H_ |
7 |
|
|
8 |
+ |
#include "color.h" |
9 |
|
#include "tonemap.h" |
10 |
|
#include "rhdriver.h" |
11 |
< |
/* child ordering */ |
11 |
> |
|
12 |
> |
#ifdef __cplusplus |
13 |
> |
extern "C" { |
14 |
> |
#endif |
15 |
> |
|
16 |
|
#define DL 0 /* down left */ |
17 |
|
#define DR 1 /* down right */ |
18 |
|
#define UL 2 /* up left */ |
37 |
|
|
38 |
|
extern struct rleaves { |
39 |
|
float (*wp)[3]; /* world intersection point array */ |
40 |
+ |
int32 *wd; /* world direction array */ |
41 |
|
TMbright *brt; /* encoded brightness array */ |
42 |
|
BYTE (*chr)[3]; /* encoded chrominance array */ |
43 |
|
BYTE (*rgb)[3]; /* tone-mapped color array */ |
47 |
|
char *base; /* base of allocated memory */ |
48 |
|
} qtL; /* our pile of leaves */ |
49 |
|
|
50 |
+ |
#define is_stump(t) (!((t)->flgs & (BR_ANY|LF_ANY))) |
51 |
+ |
|
52 |
|
extern RTREE qtrunk; /* trunk of quadtree */ |
53 |
|
extern double qtDepthEps; /* epsilon to compare depths (z fraction) */ |
54 |
|
extern int qtMinNodesiz; /* minimum node dimension (pixels) */ |
55 |
|
|
56 |
+ |
extern int rayqleft; /* number of rays to queue before flush */ |
57 |
|
|
58 |
< |
/************************************************************************ |
59 |
< |
* These driver support routines implement the dev_value() call, but |
60 |
< |
* require the following callbacks: |
58 |
> |
/* |
59 |
> |
extern int32 encodedir(); |
60 |
> |
extern double fdir2diff(), dir2diff(); |
61 |
> |
*/ |
62 |
|
|
63 |
< |
dev_paintr(rgb, x0, y0, x1, y1) : paint a rectangle |
64 |
< |
BYTE rgb[3]; : rectangle color |
65 |
< |
int x0, y0, x1, y1; : rectangle boundaries |
63 |
> |
/* rhd_qtree.c */ |
64 |
> |
extern int qtAllocLeaves(register int n); |
65 |
> |
extern void qtFreeLeaves(void); |
66 |
> |
extern int qtCompost(int pct); |
67 |
> |
extern void qtReplant(void); |
68 |
> |
extern int qtFindLeaf(int x, int y); |
69 |
> |
extern int qtMapLeaves(int redo); |
70 |
> |
/* rhd_qtree2c.c rhd_qtree2r.c */ |
71 |
> |
extern void qtRedraw(int x0, int y0, int x1, int y1); |
72 |
> |
extern void qtUpdate(void); |
73 |
|
|
74 |
< |
Draws an open rectangle between [x0,x1) and [y0,y1) with the color rgb. |
75 |
< |
This function is called many times by qtUpdate(), qtRedraw() and qtReplant(). |
74 |
> |
#ifdef __cplusplus |
75 |
> |
} |
76 |
> |
#endif |
77 |
> |
#endif /* _RAD_RHD_QTREE_H_ */ |
78 |
|
|
61 |
– |
************************************************************************/ |