904 |
|
op = addarg(op, "-ds .1 -dj .9"); |
905 |
|
else |
906 |
|
op = addarg(op, "-ds .2"); |
907 |
< |
op = addarg(op, "-dt .05 -dc .75 -dr 3 -ss 50 -st .01"); |
907 |
> |
op = addarg(op, "-dt .05 -dc .75 -dr 3 -ss 16 -st .01"); |
908 |
|
sprintf(op, " -ab %d", overture=vint(INDIRECT)+1); |
909 |
|
op += strlen(op); |
910 |
|
if (vdef(AMBFILE)) { |
1261 |
|
) |
1262 |
|
{ |
1263 |
|
#define do_rpiece (sfile[0]!='\0') |
1264 |
< |
char combuf[4*PATH_MAX+512]; |
1264 |
> |
char combuf[5*PATH_MAX+512]; |
1265 |
|
char rawfile[PATH_MAX], picfile[PATH_MAX]; |
1266 |
|
char zopt[PATH_MAX+4], rep[PATH_MAX+16], res[32]; |
1267 |
< |
char rppopt[128], sfile[64], *pfile = NULL; |
1267 |
> |
char rppopt[32], sfile[PATH_MAX], *pfile = NULL; |
1268 |
|
char pfopts[128]; |
1269 |
|
char vs[32], *vw; |
1270 |
|
int vn, mult; |
1271 |
|
FILE *fp; |
1272 |
|
time_t rfdt, pfdt; |
1273 |
+ |
int xres, yres; |
1274 |
+ |
double aspect; |
1275 |
+ |
int n; |
1276 |
|
/* get pfilt options */ |
1277 |
|
pfiltopts(pfopts); |
1278 |
|
/* get resolution, reporting */ |
1287 |
|
mult = 3; |
1288 |
|
break; |
1289 |
|
} |
1290 |
< |
{ |
1291 |
< |
int xres, yres; |
1292 |
< |
double aspect; |
1293 |
< |
int n; |
1294 |
< |
n = sscanf(vval(RESOLUTION), "%d %d %lf", &xres, &yres, &aspect); |
1295 |
< |
if (n == 3) |
1296 |
< |
sprintf(res, "-x %d -y %d -pa %.3f", |
1297 |
< |
mult*xres, mult*yres, aspect); |
1298 |
< |
else if (n) { |
1299 |
< |
if (n == 1) yres = xres; |
1297 |
< |
sprintf(res, "-x %d -y %d", mult*xres, mult*yres); |
1298 |
< |
} else |
1299 |
< |
badvalue(RESOLUTION); |
1300 |
< |
} |
1290 |
> |
n = sscanf(vval(RESOLUTION), "%d %d %lf", &xres, &yres, &aspect); |
1291 |
> |
if (n == 3) |
1292 |
> |
sprintf(res, "-x %d -y %d -pa %.3f", |
1293 |
> |
mult*xres, mult*yres, aspect); |
1294 |
> |
else if (n) { |
1295 |
> |
aspect = 1.; |
1296 |
> |
if (n == 1) yres = xres; |
1297 |
> |
sprintf(res, "-x %d -y %d", mult*xres, mult*yres); |
1298 |
> |
} else |
1299 |
> |
badvalue(RESOLUTION); |
1300 |
|
rep[0] = '\0'; |
1301 |
|
if (vdef(REPORT)) { |
1302 |
|
double minutes; |
1304 |
– |
int n; |
1303 |
|
n = sscanf(vval(REPORT), "%lf %s", &minutes, rawfile); |
1304 |
|
if (n == 2) |
1305 |
|
sprintf(rep, " -t %d -e %s", (int)(minutes*60), rawfile); |
1314 |
|
getview(0, vs) != NULL) { |
1315 |
|
if (!strcmp(c_rpict, DEF_RPICT_PATH) && |
1316 |
|
getview(1, NULL) == NULL) { |
1317 |
< |
sprintf(sfile, "rpsync_%s.txt", vs); |
1317 |
> |
sprintf(sfile, "%s_%s_rpsync.txt", |
1318 |
> |
vdef(RAWFILE) ? vval(RAWFILE) : vval(PICTURE), |
1319 |
> |
vs); |
1320 |
|
strcpy(rppopt, "-PP pfXXXXXX"); |
1321 |
|
} else { |
1322 |
|
strcpy(rppopt, "-S 1 -PP pfXXXXXX"); |
1359 |
|
if (do_rpiece) { |
1360 |
|
if (rfdt < oct1date || !fdate(sfile)) { |
1361 |
|
int xdiv = 8+nprocs/3, ydiv = 8+nprocs/3; |
1362 |
< |
rfdt = 0; /* start fresh */ |
1362 |
> |
if (rfdt >= oct1date) { |
1363 |
> |
fprintf(stderr, |
1364 |
> |
"%s: partial output not created with rpiece\n", rawfile); |
1365 |
> |
quit(1); |
1366 |
> |
} |
1367 |
> |
if (rfdt) { /* start fresh */ |
1368 |
> |
rmfile(rawfile); |
1369 |
> |
rfdt = 0; |
1370 |
> |
} |
1371 |
|
if (!silent) |
1372 |
|
printf("\techo %d %d > %s\n", |
1373 |
|
xdiv, ydiv, sfile); |
1404 |
|
} else { |
1405 |
|
if (overture) { /* run overture calculation */ |
1406 |
|
sprintf(combuf, |
1407 |
< |
"%s%s %s%s -x 64 -y 64 -ps 1 %s > %s", |
1407 |
> |
"%s%s %s%s -x 64 -y 64 -ps 1 %s > %s", |
1408 |
|
c_rpict, rep, vw, opts, |
1409 |
|
oct1name, overfile); |
1410 |
< |
if (do_rpiece) |
1411 |
< |
while (next_process(1)) |
1412 |
< |
sleep(5); |
1405 |
< |
if (runcom(combuf)) { |
1406 |
< |
fprintf(stderr, |
1410 |
> |
if (!do_rpiece || !next_process(0)) { |
1411 |
> |
if (runcom(combuf)) { |
1412 |
> |
fprintf(stderr, |
1413 |
|
"%s: error in overture for view %s\n", |
1414 |
< |
progname, vs); |
1415 |
< |
quit(1); |
1416 |
< |
} |
1411 |
< |
if (do_rpiece) { |
1412 |
< |
finish_process(); |
1413 |
< |
wait_process(1); |
1414 |
< |
} |
1414 |
> |
progname, vs); |
1415 |
> |
quit(1); |
1416 |
> |
} |
1417 |
|
#ifndef NULL_DEVICE |
1418 |
< |
rmfile(overfile); |
1418 |
> |
rmfile(overfile); |
1419 |
|
#endif |
1420 |
+ |
} else if (do_rpiece) |
1421 |
+ |
sleep(20); |
1422 |
|
} |
1423 |
|
if (do_rpiece) { |
1424 |
|
sprintf(combuf, "%s -F %s %s%s %s %s%s%s -o %s %s", |
1454 |
|
} |
1455 |
|
if (!vdef(RAWFILE) || strcmp(vval(RAWFILE),vval(PICTURE))) { |
1456 |
|
/* build pfilt command */ |
1457 |
< |
if (mult > 1) |
1457 |
> |
if (do_rpiece) |
1458 |
> |
sprintf(combuf, |
1459 |
> |
"%s%s -x %d -y %d -p %.3f %s > %s", |
1460 |
> |
c_pfilt, pfopts, xres, yres, aspect, |
1461 |
> |
rawfile, picfile); |
1462 |
> |
else if (mult > 1) |
1463 |
|
sprintf(combuf, "%s%s -x /%d -y /%d %s > %s", |
1464 |
|
c_pfilt, pfopts, mult, mult, |
1465 |
|
rawfile, picfile); |
1579 |
|
child_pid = fork(); /* split process */ |
1580 |
|
if (child_pid == 0) { /* we're the child */ |
1581 |
|
children_running = -1; |
1582 |
+ |
nprocs = 1; |
1583 |
|
return(0); |
1584 |
|
} |
1585 |
|
if (child_pid > 0) { /* we're the parent */ |