| 281 |
|
return(0); |
| 282 |
|
while ((fnames = nextword(thisfile, PATH_MAX, fnames)) != NULL) { |
| 283 |
|
if (thisfile[0] == '!' || |
| 284 |
< |
(thisfile[0] == '\\' && thisfile[1] == '!')) |
| 284 |
> |
(thisfile[0] == '\\' && thisfile[1] == '!')) { |
| 285 |
> |
if (!lastdate) |
| 286 |
> |
lastdate = 1; |
| 287 |
|
continue; |
| 288 |
+ |
} |
| 289 |
|
if (!(thisdate = fdate(thisfile))) |
| 290 |
|
syserr(thisfile); |
| 291 |
|
if (thisdate > lastdate) |
| 472 |
|
oconv(void) /* run oconv and mkillum if necessary */ |
| 473 |
|
{ |
| 474 |
|
static char illumtmp[] = "ilXXXXXX"; |
| 475 |
< |
char combuf[PATH_MAX], ocopts[64], mkopts[64]; |
| 475 |
> |
char combuf[PATH_MAX], ocopts[64], mkopts[1024]; |
| 476 |
|
|
| 477 |
|
oconvopts(ocopts); /* get options */ |
| 478 |
|
if (octreedate < scenedate) { /* check date on original octree */ |
| 599 |
|
|
| 600 |
|
static void |
| 601 |
|
mkillumopts( /* get mkillum options */ |
| 602 |
< |
register char *mo |
| 602 |
> |
char *mo |
| 603 |
|
) |
| 604 |
|
{ |
| 605 |
|
/* BEWARE: This may be called via setdefaults(), so no assumptions */ |
| 606 |
|
|
| 607 |
< |
*mo = '\0'; |
| 607 |
> |
if (nprocs > 1) { |
| 608 |
> |
sprintf(mo, " -n %d", nprocs); |
| 609 |
> |
while (*mo) |
| 610 |
> |
mo++; |
| 611 |
> |
} else |
| 612 |
> |
*mo = '\0'; |
| 613 |
|
if (vdef(MKILLUM)) |
| 614 |
|
addarg(mo, vval(MKILLUM)); |
| 615 |
|
} |
| 1012 |
|
} else if (*vs == 'z') { |
| 1013 |
|
zpos = -1; vs++; |
| 1014 |
|
} |
| 1015 |
< |
viewtype = 'v'; |
| 1016 |
< |
if((*vs == 'v') | (*vs == 'l') | (*vs == 'a') | (*vs == 'h') | (*vs == 'c')) |
| 1015 |
> |
switch (*vs) { |
| 1016 |
> |
case VT_PER: |
| 1017 |
> |
case VT_PAR: |
| 1018 |
> |
case VT_ANG: |
| 1019 |
> |
case VT_HEM: |
| 1020 |
> |
case VT_PLS: |
| 1021 |
> |
case VT_CYL: |
| 1022 |
|
viewtype = *vs++; |
| 1023 |
+ |
break; |
| 1024 |
+ |
default: |
| 1025 |
+ |
viewtype = VT_PER; |
| 1026 |
+ |
break; |
| 1027 |
+ |
} |
| 1028 |
|
cp = viewopts; |
| 1029 |
|
if ((!*vs || isspace(*vs)) && (xpos|ypos|zpos)) { /* got one! */ |
| 1030 |
|
*cp++ = '-'; *cp++ = 'v'; *cp++ = 't'; *cp++ = viewtype; |
| 1066 |
|
} |
| 1067 |
|
cp = addarg(cp, vup[upax+3]); |
| 1068 |
|
switch (viewtype) { |
| 1069 |
< |
case 'v': |
| 1069 |
> |
case VT_PER: |
| 1070 |
|
cp = addarg(cp, "-vh 45 -vv 45"); |
| 1071 |
|
break; |
| 1072 |
< |
case 'l': |
| 1072 |
> |
case VT_PAR: |
| 1073 |
|
d = sqrt(dim[0]*dim[0]+dim[1]*dim[1]+dim[2]*dim[2]); |
| 1074 |
|
sprintf(cp, " -vh %.2g -vv %.2g", d, d); |
| 1075 |
|
cp += strlen(cp); |
| 1076 |
|
break; |
| 1077 |
< |
case 'a': |
| 1078 |
< |
case 'h': |
| 1077 |
> |
case VT_ANG: |
| 1078 |
> |
case VT_HEM: |
| 1079 |
> |
case VT_PLS: |
| 1080 |
|
cp = addarg(cp, "-vh 180 -vv 180"); |
| 1081 |
|
break; |
| 1082 |
< |
case 'c': |
| 1082 |
> |
case VT_CYL: |
| 1083 |
|
cp = addarg(cp, "-vh 180 -vv 90"); |
| 1084 |
|
break; |
| 1085 |
|
} |
| 1156 |
|
VIEW vwr; |
| 1157 |
|
char buf[128]; |
| 1158 |
|
register char *cp; |
| 1159 |
+ |
#ifdef _WIN32 |
| 1160 |
+ |
/* XXX Should we allow something like this for all platforms? */ |
| 1161 |
+ |
/* XXX Or is it still required at all? */ |
| 1162 |
+ |
again: |
| 1163 |
+ |
#endif |
| 1164 |
|
if (vopts == NULL) |
| 1165 |
|
return(-1); |
| 1166 |
|
#ifdef _WIN32 |
| 1333 |
|
/* rpict persistent mode */ |
| 1334 |
|
if (!silent) |
| 1335 |
|
printf("\t%s\n", combuf); |
| 1336 |
+ |
fflush(stdout); |
| 1337 |
|
sprintf(combuf, "rpict%s %s %s%s%s %s > %s", |
| 1338 |
|
rep, rppopt, res, po, opts, |
| 1339 |
|
oct1name, rawfile); |
| 1315 |
– |
fflush(stdout); |
| 1340 |
|
fp = popen(combuf, "w"); |
| 1341 |
|
if (fp == NULL) |
| 1342 |
|
goto rperror; |
| 1374 |
|
} |
| 1375 |
|
wait_process(1); /* wait for children to finish */ |
| 1376 |
|
if (pfile != NULL) { /* clean up rpict persistent mode */ |
| 1377 |
< |
int pid; |
| 1377 |
> |
RT_PID pid; |
| 1378 |
|
fp = fopen(pfile, "r"); |
| 1379 |
|
if (fp != NULL) { |
| 1380 |
|
if (fscanf(fp, "%*s %d", &pid) != 1 || |
| 1417 |
|
printf("\t%s\n", cs); |
| 1418 |
|
if (!nprocs) |
| 1419 |
|
return(0); |
| 1420 |
< |
fflush(stdout); /* flush output and pass to shell */ |
| 1420 |
> |
fflush(NULL); /* flush output and pass to shell */ |
| 1421 |
|
return(system(cs)); |
| 1422 |
|
} |
| 1423 |
|
|
| 1453 |
|
static int |
| 1454 |
|
next_process(void) /* fork the next process (max. nprocs) */ |
| 1455 |
|
{ |
| 1456 |
< |
int child_pid; |
| 1456 |
> |
RT_PID child_pid; |
| 1457 |
|
|
| 1458 |
|
if (nprocs <= 1) |
| 1459 |
|
return(0); /* it's us or no one */ |
| 1464 |
|
} |
| 1465 |
|
if (children_running >= nprocs) |
| 1466 |
|
wait_process(0); /* wait for someone to finish */ |
| 1467 |
< |
fflush(stdout); |
| 1467 |
> |
fflush(NULL); /* flush output */ |
| 1468 |
|
child_pid = fork(); /* split process */ |
| 1469 |
|
if (child_pid == 0) { /* we're the child */ |
| 1470 |
|
children_running = -1; |
| 1484 |
|
) |
| 1485 |
|
{ |
| 1486 |
|
int ourstatus = 0; |
| 1487 |
< |
int pid, status; |
| 1487 |
> |
RT_PID pid, status; |
| 1488 |
|
|
| 1489 |
|
if (all) |
| 1490 |
|
all = children_running; |
| 1521 |
|
} |
| 1522 |
|
int |
| 1523 |
|
kill(pid, sig) /* win|unix_process.c should also wait and kill */ |
| 1524 |
< |
int pid, sig; |
| 1524 |
> |
RT_PID pid, sig; |
| 1525 |
|
{ |
| 1526 |
|
return 0; |
| 1527 |
|
} |