| 1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* Holodeck beam support for display process |
| 6 |
|
*/ |
| 27 |
|
FVECT cp[4], ip[4], pf, pb; |
| 28 |
|
double af, ab, sf2, sb2, dfb2, df2, db2, penalty; |
| 29 |
|
register int i; |
| 30 |
+ |
/* special case */ |
| 31 |
+ |
if (hr <= 0 | vr <= 0) |
| 32 |
+ |
return(0); |
| 33 |
|
/* compute cell corners in image */ |
| 34 |
|
if (!hdbcoord(gc, hp, bi)) |
| 35 |
|
error(CONSISTENCY, "bad beam index in npixels"); |
| 53 |
|
(ip[1][0]-ip[3][0])*(ip[2][1]-ip[3][1]); |
| 54 |
|
af *= af >= 0 ? 0.5 : -0.5; |
| 55 |
|
getback: |
| 56 |
< |
copystruct(&vrev, vp); /* compute reverse view */ |
| 56 |
> |
vrev = *vp; /* compute reverse view */ |
| 57 |
|
for (i = 0; i < 3; i++) { |
| 58 |
|
vrev.vdir[i] = -vp->vdir[i]; |
| 59 |
|
vrev.vup[i] = -vp->vup[i]; |
| 239 |
|
GCOORD *gcp; |
| 240 |
|
register struct cellist *cl; |
| 241 |
|
{ |
| 242 |
< |
copystruct(cl->cl+cl->n, gcp); |
| 242 |
> |
*(cl->cl+cl->n) = *gcp; |
| 243 |
|
cl->n++; |
| 244 |
|
return(1); |
| 245 |
|
} |
| 281 |
|
if (cl.cl == NULL) |
| 282 |
|
goto memerr; |
| 283 |
|
cl.n = 0; /* add cells within pyramid */ |
| 284 |
< |
visit_cells(org, dir, hp, addcell, &cl); |
| 284 |
> |
visit_cells(org, dir, hp, addcell, (char *)&cl); |
| 285 |
|
if (!cl.n) { |
| 286 |
< |
free((char *)cl.cl); |
| 286 |
> |
free((void *)cl.cl); |
| 287 |
|
return(NULL); |
| 288 |
|
} |
| 289 |
|
*np = cl.n * orient; |
| 292 |
|
* sorted automatically by visit_cells(), so we don't need this. |
| 293 |
|
*/ |
| 294 |
|
/* optimize memory use */ |
| 295 |
< |
cl.cl = (GCOORD *)realloc((char *)cl.cl, cl.n*sizeof(GCOORD)); |
| 295 |
> |
cl.cl = (GCOORD *)realloc((void *)cl.cl, cl.n*sizeof(GCOORD)); |
| 296 |
|
if (cl.cl == NULL) |
| 297 |
|
goto memerr; |
| 298 |
|
/* sort the list */ |