7 |
|
|
8 |
|
#include "rholo.h" |
9 |
|
#include "rhdisp.h" |
10 |
– |
#include "view.h" |
10 |
|
|
11 |
|
struct cellist { |
12 |
|
GCOORD *cl; |
37 |
|
pf[i] = 0.5*(cp[0][i] + cp[2][i]); |
38 |
|
sf2 = 0.25*dist2(cp[0], cp[2]); /* compute half diagonal length */ |
39 |
|
for (i = 0; i < 4; i++) { /* compute visible quad */ |
40 |
< |
viewloc(ip[i], vp, cp[i]); |
42 |
< |
if (ip[i][2] < 0.) { |
40 |
> |
if (viewloc(ip[i], vp, cp[i]) <= 0) { |
41 |
|
af = 0; |
42 |
|
goto getback; |
43 |
|
} |
51 |
|
(ip[1][0]-ip[3][0])*(ip[2][1]-ip[3][1]); |
52 |
|
af *= af >= 0 ? 0.5 : -0.5; |
53 |
|
getback: |
54 |
< |
copystruct(&vrev, vp); /* compute reverse view */ |
54 |
> |
vrev = *vp; /* compute reverse view */ |
55 |
|
for (i = 0; i < 3; i++) { |
56 |
|
vrev.vdir[i] = -vp->vdir[i]; |
57 |
|
vrev.vup[i] = -vp->vup[i]; |
63 |
|
pb[i] = 0.5*(cp[0][i] + cp[2][i]); |
64 |
|
sb2 = 0.25*dist2(cp[0], cp[2]); /* compute half diagonal length */ |
65 |
|
for (i = 0; i < 4; i++) { /* compute visible quad */ |
66 |
< |
viewloc(ip[i], &vrev, cp[i]); |
69 |
< |
if (ip[i][2] < 0.) { |
66 |
> |
if (viewloc(ip[i], &vrev, cp[i]) <= 0) { |
67 |
|
ab = 0; |
68 |
|
goto finish; |
69 |
|
} |
236 |
|
GCOORD *gcp; |
237 |
|
register struct cellist *cl; |
238 |
|
{ |
239 |
< |
copystruct(cl->cl+cl->n, gcp); |
239 |
> |
*(cl->cl+cl->n) = *gcp; |
240 |
|
cl->n++; |
241 |
|
return(1); |
242 |
|
} |
301 |
|
} |
302 |
|
|
303 |
|
|
304 |
< |
gridlines(f) /* run through holodeck section grid lines */ |
305 |
< |
int (*f)(); |
304 |
> |
extern void |
305 |
> |
gridlines( /* run through holodeck section grid lines */ |
306 |
> |
void (*f)(FVECT wp[2]) |
307 |
> |
) |
308 |
|
{ |
309 |
|
register int hd, w, i; |
310 |
|
int g0, g1; |