11 |
|
#include <X11/extensions/SGIStereo.h> |
12 |
|
#endif |
13 |
|
#include <ctype.h> |
14 |
+ |
#include <string.h> |
15 |
|
#include <time.h> |
16 |
+ |
|
17 |
|
#include "radogl.h" |
18 |
|
#include "view.h" |
19 |
|
#include "paths.h" |
20 |
|
#include "glradicon.h" |
21 |
+ |
#include "rtprocess.h" |
22 |
|
|
23 |
|
#ifndef MAXVIEW |
24 |
|
#define MAXVIEW 63 /* maximum number of standard views */ |
75 |
|
int nscenef = 0; /* number of scene files */ |
76 |
|
char *octree; /* octree name (NULL if unnec.) */ |
77 |
|
|
78 |
< |
int rtpd[3]; /* rtrace process descriptors */ |
78 |
> |
SUBPROC rtpd; /* rtrace process descriptors */ |
79 |
|
|
80 |
|
int silent = 0; /* run rad silently? */ |
81 |
|
int backvis = 1; /* back faces visible? */ |
182 |
|
{ |
183 |
|
if (ourdisplay != NULL) |
184 |
|
dev_close(); |
185 |
< |
if (rtpd[2] > 0) { |
186 |
< |
if (close_process(rtpd) > 0) |
185 |
> |
/* if (rtpd.pid > 0) { */ |
186 |
> |
if (rtpd.running) { |
187 |
> |
if (close_process(&rtpd) > 0) |
188 |
|
wputs("bad exit status from rtrace\n"); |
189 |
< |
rtpd[2] = 0; |
189 |
> |
/* rtpd.pid = 0; */ |
190 |
|
} |
191 |
|
exit(code); |
192 |
|
} |
202 |
|
if (nowarn) av[ac++] = "-w-"; |
203 |
|
av[ac++] = octname; |
204 |
|
av[ac] = NULL; |
205 |
< |
if (open_process(rtpd, av) <= 0) |
205 |
> |
if (open_process(&rtpd, av) <= 0) |
206 |
|
error(SYSTEM, "cannot start rtrace process"); |
207 |
|
} |
208 |
|
|
679 |
|
{ |
680 |
|
float fbuf[6]; |
681 |
|
/* check to see if rtrace is running */ |
682 |
< |
if (rtpd[2] <= 0) |
682 |
> |
/* if (rtpd.pid <= 0) */ |
683 |
> |
if (!rtpd.running) |
684 |
|
return(0); |
685 |
|
/* assign origin */ |
686 |
|
fbuf[0] = org[0]; fbuf[1] = org[1]; fbuf[2] = org[2]; |
688 |
|
if (md <= FTINY) md = FHUGE; |
689 |
|
fbuf[3] = dir[0]*md; fbuf[4] = dir[1]*md; fbuf[5] = dir[2]*md; |
690 |
|
/* trace that ray */ |
691 |
< |
if (process(rtpd, (char *)fbuf, (char *)fbuf, |
691 |
> |
if (process(&rtpd, (char *)fbuf, (char *)fbuf, |
692 |
|
4*sizeof(float), 6*sizeof(float)) != 4*sizeof(float)) |
693 |
|
error(INTERNAL, "error getting data back from rtrace process"); |
694 |
|
if (fbuf[3] >= .99*FHUGE) |
831 |
|
{ |
832 |
|
FILE *fp; |
833 |
|
/* check if already in there */ |
834 |
< |
if (!bcmp(&thisview, vwl[currentview].v, sizeof(VIEW))) { |
834 |
> |
if (!memcmp(&thisview, vwl[currentview].v, sizeof(VIEW))) { |
835 |
|
error(COMMAND, "view already in standard list"); |
836 |
|
return; |
837 |
|
} |