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