1254 |
|
} |
1255 |
|
|
1256 |
|
|
1257 |
+ |
static int |
1258 |
+ |
syncf_done( /* check if an rpiece sync file is complete */ |
1259 |
+ |
char *sfname |
1260 |
+ |
) |
1261 |
+ |
{ |
1262 |
+ |
FILE *fp = fopen(sfname, "r"); |
1263 |
+ |
int todo = 1; |
1264 |
+ |
int x, y; |
1265 |
+ |
|
1266 |
+ |
if (fp == NULL) |
1267 |
+ |
return(0); |
1268 |
+ |
if (fscanf(fp, "%d %d", &x, &y) != 2) |
1269 |
+ |
goto checked; |
1270 |
+ |
todo = x*y; /* total number of tiles */ |
1271 |
+ |
if (fscanf(fp, "%d %d", &x, &y) != 2 || (x != 0) | (y != 0)) |
1272 |
+ |
goto checked; |
1273 |
+ |
/* XXX assume no redundant tiles */ |
1274 |
+ |
while (fscanf(fp, "%d %d", &x, &y) == 2) |
1275 |
+ |
if (!--todo) |
1276 |
+ |
break; |
1277 |
+ |
checked: |
1278 |
+ |
fclose(fp); |
1279 |
+ |
return(!todo); |
1280 |
+ |
} |
1281 |
+ |
|
1282 |
+ |
|
1283 |
|
static void |
1284 |
|
rpict( /* run rpict and pfilt for each view */ |
1285 |
|
char *opts, |
1476 |
|
if (do_rpiece) { /* need to finish raw, first */ |
1477 |
|
finish_process(); |
1478 |
|
wait_process(1); |
1479 |
< |
/* XXX should check sync file to see if really done? */ |
1479 |
> |
if (!syncf_done(sfile)) { |
1480 |
> |
fprintf(stderr, |
1481 |
> |
"%s: rpiece did not complete rendering of view %s\n", |
1482 |
> |
progname, vs); |
1483 |
> |
quit(1); |
1484 |
> |
} |
1485 |
|
} |
1486 |
|
if (!vdef(RAWFILE) || strcmp(vval(RAWFILE),vval(PICTURE))) { |
1487 |
|
/* build pfilt command */ |