| 7 |
|
* Greg Ward 09Dec89 |
| 8 |
|
*/ |
| 9 |
|
|
| 10 |
< |
#include "standard.h" |
| 10 |
> |
#include "copyright.h" |
| 11 |
|
|
| 12 |
|
#include <ctype.h> |
| 13 |
|
|
| 14 |
+ |
#include "standard.h" |
| 15 |
+ |
#include "rtprocess.h" /* Windows: must come before color.h */ |
| 16 |
|
#include "view.h" |
| 15 |
– |
|
| 17 |
|
#include "color.h" |
| 18 |
|
|
| 19 |
|
#define LOG2 0.69314718055994530942 |
| 85 |
|
MAT4 theirs2ours; /* transformation matrix */ |
| 86 |
|
int hasmatrix = 0; /* has transformation matrix */ |
| 87 |
|
|
| 88 |
< |
int PDesc[3] = {-1,-1,-1}; /* rtrace process descriptor */ |
| 88 |
< |
#define childpid (PDesc[2]) |
| 88 |
> |
static SUBPROC PDesc = SP_INACTIVE; /* rtrace process descriptor */ |
| 89 |
|
unsigned short queue[PACKSIZ][2]; /* pending pixels */ |
| 90 |
|
int packsiz; /* actual packet size */ |
| 91 |
|
int queuesiz = 0; /* number of pixels pending */ |
| 1095 |
|
int rval; |
| 1096 |
|
register char **wp, *cp; |
| 1097 |
|
|
| 1098 |
< |
if (childpid != -1) { |
| 1098 |
> |
if (PDesc.running) { |
| 1099 |
|
fprintf(stderr, "%s: too many calculations\n", progname); |
| 1100 |
|
exit(1); |
| 1101 |
|
} |
| 1114 |
|
} |
| 1115 |
|
*wp = NULL; |
| 1116 |
|
/* start process */ |
| 1117 |
< |
if ((rval = open_process(PDesc, argv)) < 0) |
| 1117 |
> |
if ((rval = open_process(&PDesc, argv)) < 0) |
| 1118 |
|
syserror(progname); |
| 1119 |
|
if (rval == 0) { |
| 1120 |
|
fprintf(stderr, "%s: command not found\n", argv[0]); |
| 1129 |
|
|
| 1130 |
|
caldone() /* done with calculation */ |
| 1131 |
|
{ |
| 1132 |
< |
if (childpid == -1) |
| 1132 |
> |
if (!PDesc.running) |
| 1133 |
|
return; |
| 1134 |
|
clearqueue(); |
| 1135 |
< |
close_process(PDesc); |
| 1136 |
< |
childpid = -1; |
| 1135 |
> |
close_process(&PDesc); |
| 1136 |
|
} |
| 1137 |
|
|
| 1138 |
|
|
| 1168 |
|
} |
| 1169 |
|
/* mark end and get results */ |
| 1170 |
|
bzero((char *)fbp, 6*sizeof(float)); |
| 1171 |
< |
if (process(PDesc, (char *)fbuf, (char *)fbuf, |
| 1171 |
> |
if (process(&PDesc, (char *)fbuf, (char *)fbuf, |
| 1172 |
|
4*sizeof(float)*(queuesiz+1), |
| 1173 |
|
6*sizeof(float)*(queuesiz+1)) != |
| 1174 |
|
4*sizeof(float)*(queuesiz+1)) { |