| 5 |
|
#endif |
| 6 |
|
|
| 7 |
|
/* |
| 8 |
< |
* Holodeck beam support |
| 8 |
> |
* Holodeck beam support for display process |
| 9 |
|
*/ |
| 10 |
|
|
| 11 |
|
#include "rholo.h" |
| 90 |
|
hdworld(lo, hp, gp); |
| 91 |
|
gp[((gc.w>>1)+1)%3] = 1; |
| 92 |
|
hdworld(ld, hp, gp); |
| 93 |
< |
ld[0] -= lo[0]; ld[1] -= lo[1]; ld[2] -= lo[1]; |
| 93 |
> |
ld[0] -= lo[0]; ld[1] -= lo[1]; ld[2] -= lo[2]; |
| 94 |
|
/* find scanline limits */ |
| 95 |
|
lbeg = 0; lend = hp->grid[((gc.w>>1)+1)%3]; |
| 96 |
|
for (i = 0; i < 4; i++) { |
| 97 |
|
t = DOT(pn[i], lo) - po[i]; |
| 98 |
|
d = -DOT(pn[i], ld); |
| 99 |
< |
if (d <= FTINY && d >= -FTINY) { |
| 100 |
< |
if (t < 0) |
| 101 |
< |
goto nextscan; |
| 102 |
< |
continue; |
| 103 |
< |
} |
| 104 |
< |
if (t > 0) { |
| 99 |
> |
if (d > FTINY) { /* <- plane */ |
| 100 |
|
if ((t /= d) < lend) |
| 101 |
|
lend = t; |
| 102 |
< |
} else { |
| 102 |
> |
} else if (d < -FTINY) { /* plane -> */ |
| 103 |
|
if ((t /= d) > lbeg) |
| 104 |
|
lbeg = t; |
| 105 |
< |
} |
| 105 |
> |
} else if (t < 0) /* outside */ |
| 106 |
> |
goto nextscan; |
| 107 |
|
} |
| 108 |
|
i = lend + .5; /* visit cells on this scan */ |
| 109 |
|
for (gc.i[0] = lbeg + .5; gc.i[0] < i; gc.i[0]++) |
| 169 |
|
return(NULL); |
| 170 |
|
} |
| 171 |
|
#if 0 |
| 172 |
< |
/* We're just going to free this memory in a moment, and list is */ |
| 173 |
< |
/* sorted automatically by visit_cells(), so we don't need this. */ |
| 172 |
> |
/* We're just going to free this memory in a moment, and list is |
| 173 |
> |
* sorted automatically by visit_cells(), so we don't need this. |
| 174 |
> |
*/ |
| 175 |
|
if (*cl < n) { /* optimize memory use */ |
| 176 |
|
cl = (int *)realloc((char *)cl, |
| 177 |
|
sizeof(int) + *cl*sizeof(GCOORD)); |