| 97 |
|
|
| 98 |
|
static int |
| 99 |
|
holheadline( /* check holodeck header line */ |
| 100 |
< |
register char *s, |
| 100 |
> |
char *s, |
| 101 |
|
void *vhf |
| 102 |
|
) |
| 103 |
|
{ |
| 104 |
< |
char fmt[32]; |
| 104 |
> |
char fmt[MAXFMTLEN]; |
| 105 |
|
int *hf = vhf; |
| 106 |
|
|
| 107 |
|
if (formatval(fmt, s)) { |
| 134 |
|
FILE *fp; |
| 135 |
|
int fd; |
| 136 |
|
int hflags = 0; |
| 137 |
< |
long nextloc; |
| 137 |
> |
off_t nextloc; |
| 138 |
|
int n; |
| 139 |
|
/* open holodeck file */ |
| 140 |
|
if ((fp = fopen(fname, append ? "r+" : "r")) == NULL) { |
| 152 |
|
nextloc = ftell(fp); /* get stdio position */ |
| 153 |
|
fclose(fp); /* done with stdio */ |
| 154 |
|
for (n = 0; nextloc > 0L; n++) { /* initialize each section */ |
| 155 |
< |
lseek(fd, (off_t)nextloc, SEEK_SET); |
| 155 |
> |
lseek(fd, nextloc, SEEK_SET); |
| 156 |
|
read(fd, (char *)&nextloc, sizeof(nextloc)); |
| 157 |
|
hdinit(fd, NULL)->priv = hflags&H_OBST ? &obstr : |
| 158 |
|
hflags&H_OBSF ? &unobstr : (char *)NULL; |
| 174 |
|
) |
| 175 |
|
{ |
| 176 |
|
int sn, bi, n; |
| 177 |
< |
register HOLO *hp; |
| 177 |
> |
HOLO *hp; |
| 178 |
|
GCOORD gc[2]; |
| 179 |
< |
BYTE rr[2][2]; |
| 179 |
> |
uby8 rr[2][2]; |
| 180 |
|
BEAM *bp; |
| 181 |
|
double d0, d1; |
| 182 |
|
unsigned dc; |
| 183 |
< |
register RAYVAL *rv; |
| 183 |
> |
RAYVAL *rv; |
| 184 |
|
/* check each output section */ |
| 185 |
|
for (sn = noutsects; sn--; ) { |
| 186 |
|
hp = hdlist[sn]; |
| 223 |
|
const void *b2p |
| 224 |
|
) |
| 225 |
|
{ |
| 226 |
< |
register off_t pdif = beamdir[*(int*)b1p].fo - beamdir[*(int*)b2p].fo; |
| 226 |
> |
off_t pdif = beamdir[*(int*)b1p].fo - beamdir[*(int*)b2p].fo; |
| 227 |
|
|
| 228 |
|
if (pdif > 0L) return(1); |
| 229 |
|
if (pdif < 0L) return(-1); |
| 241 |
|
FVECT ro, rd; |
| 242 |
|
double d; |
| 243 |
|
int i; |
| 244 |
< |
register int k; |
| 245 |
< |
register BEAM *bp; |
| 244 |
> |
int k; |
| 245 |
> |
BEAM *bp; |
| 246 |
|
/* sort based on file position */ |
| 247 |
|
beamdir = hp->bi; |
| 248 |
|
qsort((char *)bq, nb, sizeof(*bq), bpcmp); |
| 334 |
|
double aftd; |
| 335 |
|
COLOR ctmp; |
| 336 |
|
int j; |
| 337 |
< |
register int i; |
| 337 |
> |
int i; |
| 338 |
|
/* open files */ |
| 339 |
|
if ((pfp = fopen(pcf, "r")) == NULL) { |
| 340 |
|
sprintf(errmsg, "cannot open picture file \"%s\"", pcf); |
| 359 |
|
error(USER, errmsg); |
| 360 |
|
} |
| 361 |
|
if (phd.altprims) { |
| 362 |
< |
sprintf(errmsg, "ignoring primary values in picture \"%s\"", |
| 362 |
> |
sprintf(errmsg, "ignoring color primaries in picture \"%s\"", |
| 363 |
|
pcf); |
| 364 |
|
error(WARNING, errmsg); |
| 365 |
|
} |
| 398 |
|
error(USER, errmsg); |
| 399 |
|
} |
| 400 |
|
for (i = scanlen(&prs); i--; ) { /* do each pixel */ |
| 401 |
+ |
if (zscn[i] <= 0.0) |
| 402 |
+ |
continue; /* illegal depth */ |
| 403 |
|
pix2loc(vl, &prs, i, j); |
| 404 |
|
aftd = viewray(ro, rd, &phd.vw, vl[0], vl[1]); |
| 405 |
|
if (aftd < -FTINY) |
| 427 |
|
|
| 428 |
|
void |
| 429 |
|
eputs( /* put error message to stderr */ |
| 430 |
< |
register char *s |
| 430 |
> |
char *s |
| 431 |
|
) |
| 432 |
|
{ |
| 433 |
|
static int midline = 0; |