70 |
|
double eyedist = 1; /* interocular distance */ |
71 |
|
VIEW lastview; /* last recorded view */ |
72 |
|
|
73 |
– |
char *progname; /* global argv[0] */ |
73 |
|
char *radfile; /* rad input file */ |
74 |
|
char *scene[MAXSCENE+1]; /* material and scene file list */ |
75 |
|
int nscenef = 0; /* number of scene files */ |
76 |
|
char *octree; /* octree name (NULL if unnec.) */ |
77 |
|
|
78 |
< |
SUBPROC rtpd; /* rtrace process descriptors */ |
78 |
> |
SUBPROC rtpd = SP_INACTIVE; /* rtrace process descriptors */ |
79 |
|
|
80 |
|
int silent = 0; /* run rad silently? */ |
81 |
|
int backvis = 1; /* back faces visible? */ |
128 |
|
char *viewsel = NULL; |
129 |
|
long vwintvl = 0; |
130 |
|
int i; |
131 |
< |
|
132 |
< |
progname = argv[0]; |
131 |
> |
/* set global progname */ |
132 |
> |
fixargv0(argv[0]); |
133 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) |
134 |
|
switch (argv[i][1]) { |
135 |
|
case 'v': |
210 |
|
if (ourdisplay != NULL) |
211 |
|
dev_close(); |
212 |
|
/* if (rtpd.pid > 0) { */ |
213 |
< |
if (rtpd.running) { |
213 |
> |
if (rtpd.flags & PF_RUNNING) { |
214 |
|
if (close_process(&rtpd) > 0) |
215 |
|
wputs("bad exit status from rtrace\n"); |
216 |
|
/* rtpd.pid = 0; */ |
740 |
|
float fbuf[6]; |
741 |
|
/* check to see if rtrace is running */ |
742 |
|
/* if (rtpd.pid <= 0) */ |
743 |
< |
if (!rtpd.running) |
743 |
> |
if (!(rtpd.flags & PF_RUNNING)) |
744 |
|
return(0); |
745 |
|
/* assign origin */ |
746 |
|
fbuf[0] = org[0]; fbuf[1] = org[1]; fbuf[2] = org[2]; |
748 |
|
if (md <= FTINY) md = FHUGE; |
749 |
|
fbuf[3] = dir[0]*md; fbuf[4] = dir[1]*md; fbuf[5] = dir[2]*md; |
750 |
|
/* trace that ray */ |
751 |
< |
if (process(&rtpd, (char *)fbuf, (char *)fbuf, |
751 |
> |
if (process(&rtpd, fbuf, fbuf, |
752 |
|
4*sizeof(float), 6*sizeof(float)) != 4*sizeof(float)) |
753 |
|
error(INTERNAL, "error getting data back from rtrace process"); |
754 |
|
if (fbuf[3] >= .99*FHUGE) |