17 |
|
static double logstep; |
18 |
|
|
19 |
|
|
20 |
< |
extern void |
20 |
> |
void |
21 |
|
hdcompgrid( /* compute derived grid vector and index */ |
22 |
< |
register HOLO *hp |
22 |
> |
HOLO *hp |
23 |
|
) |
24 |
|
{ |
25 |
|
double d; |
26 |
< |
register int i, j; |
26 |
> |
int i, j; |
27 |
|
/* initialize depth map */ |
28 |
|
if (hd_depthmap[0] < 1.) { |
29 |
|
d = 1. + .5/DCLIN; |
56 |
|
} |
57 |
|
|
58 |
|
|
59 |
< |
extern int |
59 |
> |
int |
60 |
|
hdbcoord( /* compute beam coordinates from index */ |
61 |
|
GCOORD gc[2], /* returned */ |
62 |
< |
register HOLO *hp, |
63 |
< |
register int i |
62 |
> |
HOLO *hp, |
63 |
> |
int i |
64 |
|
) |
65 |
|
{ |
66 |
< |
register int j, n; |
66 |
> |
int j, n; |
67 |
|
int n2, reverse; |
68 |
|
GCOORD g2[2]; |
69 |
|
/* check range */ |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
< |
extern int |
105 |
> |
int |
106 |
|
hdbindex( /* compute index from beam coordinates */ |
107 |
< |
register HOLO *hp, |
108 |
< |
register GCOORD gc[2] |
107 |
> |
HOLO *hp, |
108 |
> |
GCOORD gc[2] |
109 |
|
) |
110 |
|
{ |
111 |
|
GCOORD g2[2]; |
112 |
|
int reverse; |
113 |
< |
register int i, j; |
113 |
> |
int i, j; |
114 |
|
/* check ordering and limits */ |
115 |
|
if ( (reverse = gc[0].w > gc[1].w) ) { |
116 |
|
*g2 = *(gc+1); |
134 |
|
} |
135 |
|
|
136 |
|
|
137 |
< |
extern void |
137 |
> |
void |
138 |
|
hdcell( /* compute cell coordinates */ |
139 |
< |
register FVECT cp[4], /* returned (may be passed as FVECT cp[2][2]) */ |
140 |
< |
register HOLO *hp, |
141 |
< |
register GCOORD *gc |
139 |
> |
FVECT cp[4], /* returned (may be passed as FVECT cp[2][2]) */ |
140 |
> |
HOLO *hp, |
141 |
> |
GCOORD *gc |
142 |
|
) |
143 |
|
{ |
144 |
< |
register RREAL *v; |
144 |
> |
RREAL *v; |
145 |
|
double d; |
146 |
|
/* compute common component */ |
147 |
|
VCOPY(cp[0], hp->orig); |
168 |
|
} |
169 |
|
|
170 |
|
|
171 |
< |
extern int |
171 |
> |
int |
172 |
|
hdlseg( /* compute line segment for beam */ |
173 |
< |
register int lseg[2][3], |
174 |
< |
register HOLO *hp, |
173 |
> |
int lseg[2][3], |
174 |
> |
HOLO *hp, |
175 |
|
GCOORD gc[2] |
176 |
|
) |
177 |
|
{ |
178 |
< |
register int k; |
178 |
> |
int k; |
179 |
|
|
180 |
|
for (k = 0; k < 2; k++) { /* compute end points */ |
181 |
|
lseg[k][gc[k].w>>1] = gc[k].w&1 ? hp->grid[gc[k].w>>1]-1 : 0 ; |
186 |
|
} |
187 |
|
|
188 |
|
|
189 |
< |
extern unsigned int |
189 |
> |
unsigned int |
190 |
|
hdcode( /* compute depth code for d */ |
191 |
|
HOLO *hp, |
192 |
|
double d |
193 |
|
) |
194 |
|
{ |
195 |
|
double tl = hp->tlin; |
196 |
< |
register long c; |
196 |
> |
long c; |
197 |
|
|
198 |
|
if (d <= 0.) |
199 |
|
return(0); |
206 |
|
} |
207 |
|
|
208 |
|
|
209 |
< |
extern void |
209 |
> |
void |
210 |
|
hdgrid( /* compute grid coordinates */ |
211 |
|
FVECT gp, /* returned */ |
212 |
< |
register HOLO *hp, |
212 |
> |
HOLO *hp, |
213 |
|
FVECT wp |
214 |
|
) |
215 |
|
{ |
222 |
|
} |
223 |
|
|
224 |
|
|
225 |
< |
extern void |
225 |
> |
void |
226 |
|
hdworld( /* compute world coordinates */ |
227 |
< |
register FVECT wp, |
228 |
< |
register HOLO *hp, |
227 |
> |
FVECT wp, |
228 |
> |
HOLO *hp, |
229 |
|
FVECT gp |
230 |
|
) |
231 |
|
{ |
232 |
< |
register double d; |
232 |
> |
double d; |
233 |
|
|
234 |
|
d = gp[0]/hp->grid[0]; |
235 |
|
VSUM(wp, hp->orig, hp->xv[0], d); |
242 |
|
} |
243 |
|
|
244 |
|
|
245 |
< |
extern double |
245 |
> |
double |
246 |
|
hdray( /* compute ray within a beam */ |
247 |
|
FVECT ro, |
248 |
|
FVECT rd, /* returned */ |
249 |
|
HOLO *hp, |
250 |
|
GCOORD gc[2], |
251 |
< |
BYTE r[2][2] |
251 |
> |
uby8 r[2][2] |
252 |
|
) |
253 |
|
{ |
254 |
|
FVECT cp[4], p[2]; |
255 |
< |
register int i, j; |
255 |
> |
int i, j; |
256 |
|
double d0, d1; |
257 |
|
/* compute entry and exit points */ |
258 |
|
for (i = 0; i < 2; i++) { |
269 |
|
} |
270 |
|
|
271 |
|
|
272 |
< |
extern double |
272 |
> |
double |
273 |
|
hdinter( /* compute ray intersection with section */ |
274 |
< |
register GCOORD gc[2], /* returned */ |
275 |
< |
BYTE r[2][2], /* returned (optional) */ |
274 |
> |
GCOORD gc[2], /* returned */ |
275 |
> |
uby8 r[2][2], /* returned (optional) */ |
276 |
|
double *ed, /* returned (optional) */ |
277 |
< |
register HOLO *hp, |
277 |
> |
HOLO *hp, |
278 |
|
FVECT ro, |
279 |
|
FVECT rd /* normalization of rd affects distances */ |
280 |
|
) |
281 |
|
{ |
282 |
|
FVECT p[2], vt; |
283 |
|
double d, t0, t1, d0, d1; |
284 |
< |
register RREAL *v; |
285 |
< |
register int i; |
284 |
> |
RREAL *v; |
285 |
> |
int i; |
286 |
|
/* first, intersect walls */ |
287 |
|
gc[0].w = gc[1].w = -1; |
288 |
|
t0 = -FHUGE; t1 = FHUGE; |