| 6 |
|
*/ |
| 7 |
|
|
| 8 |
|
#include <string.h> |
| 9 |
– |
|
| 9 |
|
#include "platform.h" |
| 10 |
|
#include "rterror.h" |
| 11 |
|
#include "rholo.h" |
| 12 |
|
|
| 14 |
– |
char *progname; /* our program name */ |
| 13 |
|
char *hdkfile; /* holodeck file name */ |
| 14 |
|
char gargc; /* global argc */ |
| 15 |
|
char **gargv; /* global argv */ |
| 48 |
|
int i, rval; |
| 49 |
|
|
| 50 |
|
gargc = argc; gargv = argv; |
| 51 |
< |
progname = argv[0]; /* get arguments */ |
| 51 |
> |
fixargv0(argv[0]); /* get arguments */ |
| 52 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) { |
| 53 |
|
rval = getviewopt(&myview, argc-i, argv+i); |
| 54 |
|
if (rval >= 0) { /* view option */ |
| 180 |
|
|
| 181 |
|
static void |
| 182 |
|
render_frame( /* render frame from beam values */ |
| 183 |
< |
register PACKHEAD *bl, |
| 183 |
> |
PACKHEAD *bl, |
| 184 |
|
int nb |
| 185 |
|
) |
| 186 |
|
{ |
| 187 |
< |
register HDBEAMI *bil; |
| 188 |
< |
register int i; |
| 187 |
> |
HDBEAMI *bil; |
| 188 |
> |
int i; |
| 189 |
|
|
| 190 |
|
if (nb <= 0) return; |
| 191 |
|
if ((bil = (HDBEAMI *)malloc(nb*sizeof(HDBEAMI))) == NULL) |
| 214 |
|
/* prepare output */ |
| 215 |
|
if (outspec != NULL) { |
| 216 |
|
sprintf(fname, outspec, fn); |
| 217 |
< |
if (freopen(fname, "w", stdout) == NULL) { |
| 217 |
> |
if (freopen(fname, "wb", stdout) == NULL) { |
| 218 |
|
sprintf(errmsg, "cannot open output \"%s\"", fname); |
| 219 |
|
error(SYSTEM, errmsg); |
| 220 |
|
} |
| 248 |
|
{ |
| 249 |
|
int lastr = -1, nunrend = 0; |
| 250 |
|
int32 lastp, lastrp; |
| 251 |
< |
register int32 p; |
| 252 |
< |
register double d; |
| 251 |
> |
int32 p; |
| 252 |
> |
double d; |
| 253 |
|
/* compute final pixel values */ |
| 254 |
|
for (p = hres*vres; p--; ) { |
| 255 |
|
if (myweight[p] <= FTINY) { |
| 283 |
|
int fd; |
| 284 |
|
FILE *fp; |
| 285 |
|
int n; |
| 286 |
< |
int32 nextloc; |
| 286 |
> |
off_t nextloc; |
| 287 |
|
/* open holodeck file */ |
| 288 |
< |
if ((fp = fopen(hdkfile, "r")) == NULL) { |
| 288 |
> |
if ((fp = fopen(hdkfile, "rb")) == NULL) { |
| 289 |
|
sprintf(errmsg, "cannot open \"%s\" for reading", hdkfile); |
| 290 |
|
error(SYSTEM, errmsg); |
| 291 |
|
} |
| 301 |
|
fd = dup(fileno(fp)); /* dup file descriptor */ |
| 302 |
|
fclose(fp); /* done with stdio */ |
| 303 |
|
for (n = 0; nextloc > 0L; n++) { /* initialize each section */ |
| 304 |
< |
lseek(fd, (off_t)nextloc, SEEK_SET); |
| 304 |
> |
lseek(fd, nextloc, SEEK_SET); |
| 305 |
|
read(fd, (char *)&nextloc, sizeof(nextloc)); |
| 306 |
|
hdinit(fd, NULL); |
| 307 |
|
} |
| 315 |
|
|
| 316 |
|
|
| 317 |
|
void |
| 318 |
< |
eputs(s) /* put error message to stderr */ |
| 321 |
< |
register char *s; |
| 318 |
> |
eputs(const char *s) /* put error message to stderr */ |
| 319 |
|
{ |
| 320 |
|
static int midline = 0; |
| 321 |
|
|