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

Comparing ray/src/hd/holo.h (file contents):
Revision 3.7 by gregl, Fri Dec 12 19:52:31 1997 UTC vs.
Revision 3.16 by gwlarson, Thu Nov 5 09:09:32 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   /* SCCSid "$SunId$ SGI" */
4  
# Line 14 | Line 14
14   #ifndef HDMAX
15   #define HDMAX           128     /* maximum active holodeck sections */
16   #endif
17 #ifndef int2
18 #define int2    short
19 #endif
20 #ifndef int4
21 #define int4    long
22 #endif
17  
18   #define DCINF   (unsigned)((1L<<16)-1)  /* special value for infinity */
19   #define DCLIN   (unsigned)(1L<<11)      /* linear depth limit */
20  
21   typedef struct {
22          BYTE    r[2][2];        /* ray direction index */
23 <        COLR    v;              /* value */
24 <        unsigned int2   d;      /* depth code */
25 < } RAYVAL;               /* ray value (from second wall) */
23 >        COLR    v;              /* color value */
24 >        unsigned int2   d;      /* depth code (from entry wall) */
25 > } RAYVAL;               /* ray value */
26  
27   /*
28   * Walls are ordered:           X0      X1      X2      WN
# Line 73 | Line 67 | typedef struct holo {
67          int     fd;             /* file descriptor */
68          short   dirty;          /* beam index needs update to file */
69          double  tlin;           /* linear range for depth encoding */
70 <        FVECT   wn[3];          /* wall normals (derived) */
71 <        double  wg[3];          /* wall grid multipliers (derived) */
78 <        double  wo[6];          /* wall offsets (derived) */
70 >        FVECT   wg[3];          /* wall grid vectors (derived) */
71 >        double  wo[6];          /* wall grid offsets (derived) */
72          int     wi[6];          /* wall super-indices (derived) */
73          char    *priv;          /* pointer to private client data */
74          BEAM    **bl;           /* beam pointers (memory cache) */
75          BEAMI   bi[1];          /* beam index (extends struct) */
76   } HOLO;                 /* holodeck section */
77  
78 < #define nbeams(hp)      (2*((hp)->wi[5]-1))
78 > typedef struct {
79 >        HOLO    *h;             /* pointer to holodeck */
80 >        int     b;              /* beam index */
81 > } HDBEAMI;              /* holodeck beam index */
82 >
83 > #define nbeams(hp)      (((hp)->wi[5]-1)<<1)
84   #define biglob(hp)      ((hp)->bi)
85   #define blglob(hp)      (*(hp)->bl)
86  
87   #define bnrays(hp,i)    ((hp)->bl[i]!=NULL ? (hp)->bl[i]->nrm : (hp)->bi[i].nrd)
88  
89 < #define hdflush(hp)     (hdfreebeam(hp,0) && hdsync(hp,0))
90 < #define hdclobber(hp)   (hdkillbeam(hp,0) && hdsync(hp,0))
89 > #define hdflush(hp)     (hdfreebeam(hp,0), hdsync(hp,0))
90 > #define hdclobber(hp)   (hdkillbeam(hp,0), hdsync(hp,0))
91  
92   extern HOLO     *hdinit(), *hdalloc();
93   extern BEAM     *hdgetbeam();
94   extern RAYVAL   *hdnewrays();
95 < extern long     hdmemuse(), hdfiluse();
95 > extern unsigned hdmemuse();
96 > extern long     hdfiluse(), hdfilen(), hdallocfrag();
97   extern double   hdray(), hdinter();
98   extern unsigned hdcode();
99 + extern int      hdfilord();
100  
101 < extern int      hdcachesize;            /* target cache size (bytes) */
101 > extern unsigned hdcachesize;            /* target cache size (bytes) */
102   extern unsigned long    hdclock;        /* holodeck system clock */
103   extern HOLO     *hdlist[HDMAX+1];       /* holodeck pointers (NULL term.) */
104  
105   extern float    hd_depthmap[];          /* depth conversion map */
106  
107 + extern int      hdwg0[6];               /* wall grid 0 index */
108 + extern int      hdwg1[6];               /* wall grid 1 index */
109 +
110   #define hddepth(hp,dc)  ( (dc) >= DCINF ? FHUGE : \
111                                  (hp)->tlin * ( (dc) >= DCLIN ? \
112                                          hd_depthmap[(dc)-DCLIN] : \
# Line 111 | Line 114 | extern float   hd_depthmap[];          /* depth conversion map *
114  
115   #define HOLOFMT         "Holodeck"      /* file format identifier */
116   #define HOLOVERS        0               /* file format version number */
117 < #define HOLOMAGIC       (327+HOLOVERS)  /* file magic number */
117 > #define HOLOMAGIC       (323+sizeof(long)+8*HOLOVERS)   /* file magic number */
118  
119   /*
120   * A holodeck file consists of an information header terminated by a

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines