--- ray/src/util/ranimate.c 2003/05/25 20:51:10 2.33 +++ ray/src/util/ranimate.c 2003/07/27 22:12:03 2.41 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ranimate.c,v 2.33 2003/05/25 20:51:10 greg Exp $"; +static const char RCSid[] = "$Id: ranimate.c,v 2.41 2003/07/27 22:12:03 schorsch Exp $"; #endif /* * Radiance animation control program @@ -15,9 +15,11 @@ static const char RCSid[] = "$Id: ranimate.c,v 2.33 20 #include "copyright.h" -#include "standard.h" #include #include + +#include "standard.h" +#include "paths.h" #include "view.h" #include "vars.h" #include "netproc.h" @@ -480,7 +482,7 @@ char *rfargs; pippt = NULL; } if (pippt != NULL) - strcpy(pippt, "> /dev/null"); /* nothing to match */ + strcpy(pippt, "> " NULL_DEVICE); /* nothing to match */ else { sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY)); cp += 11; /* point to file name */ @@ -629,15 +631,9 @@ filterframes() /* catch up with filtering */ if (astat.tnext < astat.fnext) /* other work to do first */ return; /* filter each view */ - for (i = astat.fnext; i < astat.rnext; i++) { - if ((vp = getview(i)) == NULL) { /* get view i */ - fprintf(stderr, - "%s: unexpected error reading view for frame %d\n", - progname, i); - quit(1); - } - dofilt(i, vp, getexp(i), 0); /* filter frame */ - } + for (i = astat.fnext; i < astat.rnext; i++) + dofilt(i, 0); + bwait(0); /* wait for filter processes */ archive(); /* archive originals */ astat.fnext = i; /* update status */ @@ -814,12 +810,7 @@ int frecover(frame) /* recover filtered frame */ int frame; { - VIEW *vp; - char *ex; - - vp = getview(frame); - ex = getexp(frame); - if (dofilt(frame, vp, ex, 2) && dofilt(frame, vp, ex, 1)) + if (dofilt(frame, 2) && dofilt(frame, 1)) return(1); return(0); } @@ -869,23 +860,35 @@ archive() /* archive and remove renderings */ int -dofilt(frame, vp, ep, rvr) /* filter frame */ +dofilt(frame, rvr) /* filter frame */ int frame; -VIEW *vp; -char *ep; int rvr; { extern int frecover(); static int iter = 0; double blurf; int nblur = getblur(&blurf); + VIEW *vp = getview(frame); + char *ep = getexp(frame); char fnbefore[128], fnafter[128], *fbase; char combuf[1024], fname0[128], fname1[128]; int usepinterp, usepfilt, nora_rgbe; int frseq[2]; /* check what is needed */ + if (vp == NULL) { + fprintf(stderr, + "%s: unexpected error reading view for frame %d\n", + progname, frame); + quit(1); + } + if (ep == NULL) { + fprintf(stderr, + "%s: unexpected error reading exposure for frame %d\n", + progname, frame); + quit(1); + } usepinterp = (nblur > 1); - usepfilt = pfiltalways | ep==NULL; + usepfilt = pfiltalways | (ep==NULL); if (ep != NULL && !strcmp(ep, "1")) ep = "+0"; nora_rgbe = strcmp(vval(OVERSAMP),"1") || ep==NULL || @@ -1032,7 +1035,7 @@ int n; fclose(viewfp); viewfp = NULL; viewnum = 0; - copystruct(&curview, &stdview); + curview = stdview; } return(NULL); } @@ -1048,7 +1051,7 @@ int n; perror(vval(VIEWFILE)); quit(1); } - copystruct(&curview, &stdview); + curview = stdview; viewnum = 0; } if (n < 0) { /* get next view */ @@ -1300,6 +1303,7 @@ int maxcopies; strcpy(com1=buf, com); /* build -PP command */ sprintf(com1+(ppins-com), " -PP %s/%s.persist", vval(DIRECTORY), phostname(ps)); + unlink(com1+(ppins-com)+5); strcat(com1, ppins); } else com1 = com; @@ -1360,7 +1364,7 @@ rmfile(fn) /* remove a file */ char *fn; { if (!silent) -#ifdef MSDOS +#ifdef _WIN32 printf("\tdel %s\n", fn); #else printf("\trm -f %s\n", fn); @@ -1391,7 +1395,7 @@ register char *path; for (i = 0, psep = -1; path[i]; i++) if (path[i] == '/') psep = i; - if (df != NULL) + if (df != NULL) { if (psep == 0) { df[0] = '/'; df[1] = '\0'; @@ -1400,6 +1404,7 @@ register char *path; df[psep] = '\0'; } else df[0] = '\0'; + } return(path+psep+1); }