ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimate.c
(Generate patch)

Comparing ray/src/util/ranimate.c (file contents):
Revision 2.34 by greg, Tue May 27 15:30:04 2003 UTC vs.
Revision 2.42 by schorsch, Tue Oct 21 19:19:29 2003 UTC

# Line 15 | Line 15 | static const char RCSid[] = "$Id$";
15  
16   #include "copyright.h"
17  
18 #include "standard.h"
18   #include <ctype.h>
19   #include <sys/stat.h>
20 +
21 + #include "standard.h"
22 + #include "paths.h"
23   #include "view.h"
24   #include "vars.h"
25   #include "netproc.h"
# Line 26 | Line 28 | static const char RCSid[] = "$Id$";
28   #define DEF_NBLUR       5
29   #endif
30                                  /* default remote shell */
29 #ifdef _AUX_SOURCE
30 #define REMSH           "remsh"
31 #else
31   #define REMSH           "rsh"
33 #endif
32                                  /* input variables (alphabetical by name) */
33   #define ANIMATE         0               /* animation command */
34   #define ARCHIVE         1               /* archiving command */
# Line 480 | Line 478 | char   *rfargs;
478                          pippt = NULL;
479                  }
480          if (pippt != NULL)
481 <                strcpy(pippt, "> /dev/null");   /* nothing to match */
481 >                strcpy(pippt, "> " NULL_DEVICE);        /* nothing to match */
482          else {
483                  sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY));
484                  cp += 11;               /* point to file name */
# Line 629 | Line 627 | filterframes()                         /* catch up with filtering */
627          if (astat.tnext < astat.fnext)  /* other work to do first */
628                  return;
629                                          /* filter each view */
630 <        for (i = astat.fnext; i < astat.rnext; i++) {
631 <                if ((vp = getview(i)) == NULL) {        /* get view i */
632 <                        fprintf(stderr,
635 <                        "%s: unexpected error reading view for frame %d\n",
636 <                                        progname, i);
637 <                        quit(1);
638 <                }
639 <                dofilt(i, vp, getexp(i), 0);            /* filter frame */
640 <        }
630 >        for (i = astat.fnext; i < astat.rnext; i++)
631 >                dofilt(i, 0);
632 >
633          bwait(0);                       /* wait for filter processes */
634          archive();                      /* archive originals */
635          astat.fnext = i;                /* update status */
# Line 721 | Line 713 | char   *vfn;
713                                  close(open(combuf, O_RDONLY|O_CREAT, 0666));
714                          }
715                                          /* create command */
716 <        sprintf(combuf, "rpict%s -w0", rendopt);
716 >        sprintf(combuf, "rpict%s%s -w0", rendopt,
717 >                        viewopt(getview(first>1 ? first-1 : 1)));
718          inspoint = combuf;
719          while (*inspoint) inspoint++;
720          if (nblur) {
# Line 813 | Line 806 | int
806   frecover(frame)                         /* recover filtered frame */
807   int     frame;
808   {
809 <        VIEW    *vp;
817 <        char    *ex;
818 <
819 <        vp = getview(frame);
820 <        ex = getexp(frame);
821 <        if (dofilt(frame, vp, ex, 2) && dofilt(frame, vp, ex, 1))
809 >        if (dofilt(frame, 2) && dofilt(frame, 1))
810                  return(1);
811          return(0);
812   }
# Line 868 | Line 856 | archive()                      /* archive and remove renderings */
856  
857  
858   int
859 < dofilt(frame, vp, ep, rvr)                      /* filter frame */
859 > dofilt(frame, rvr)                              /* filter frame */
860   int     frame;
873 VIEW    *vp;
874 char    *ep;
861   int     rvr;
862   {
863          extern int      frecover();
864          static int      iter = 0;
865          double  blurf;
866          int     nblur = getblur(&blurf);
867 +        VIEW    *vp = getview(frame);
868 +        char    *ep = getexp(frame);
869          char    fnbefore[128], fnafter[128], *fbase;
870          char    combuf[1024], fname0[128], fname1[128];
871          int     usepinterp, usepfilt, nora_rgbe;
872          int     frseq[2];
873                                                  /* check what is needed */
874 +        if (vp == NULL) {
875 +                 fprintf(stderr,
876 +                        "%s: unexpected error reading view for frame %d\n",
877 +                                          progname, frame);
878 +                quit(1);
879 +        }
880 +        if (ep == NULL) {
881 +                 fprintf(stderr,
882 +                        "%s: unexpected error reading exposure for frame %d\n",
883 +                                          progname, frame);
884 +                quit(1);
885 +        }
886          usepinterp = (nblur > 1);
887 <        usepfilt = pfiltalways | ep==NULL;
887 >        usepfilt = pfiltalways | (ep==NULL);
888          if (ep != NULL && !strcmp(ep, "1"))
889                  ep = "+0";
890          nora_rgbe = strcmp(vval(OVERSAMP),"1") || ep==NULL ||
# Line 1031 | Line 1031 | int    n;
1031                          fclose(viewfp);
1032                          viewfp = NULL;
1033                          viewnum = 0;
1034 <                        copystruct(&curview, &stdview);
1034 >                        curview = stdview;
1035                  }
1036                  return(NULL);
1037          }
# Line 1047 | Line 1047 | int    n;
1047                          perror(vval(VIEWFILE));
1048                          quit(1);
1049                  }
1050 <                copystruct(&curview, &stdview);
1050 >                curview = stdview;
1051                  viewnum = 0;
1052          }
1053          if (n < 0) {                            /* get next view */
# Line 1299 | Line 1299 | int    maxcopies;
1299                          strcpy(com1=buf, com);  /* build -PP command */
1300                          sprintf(com1+(ppins-com), " -PP %s/%s.persist",
1301                                          vval(DIRECTORY), phostname(ps));
1302 +                        unlink(com1+(ppins-com)+5);
1303                          strcat(com1, ppins);
1304                  } else
1305                          com1 = com;
# Line 1359 | Line 1360 | rmfile(fn)                     /* remove a file */
1360   char    *fn;
1361   {
1362          if (!silent)
1363 < #ifdef MSDOS
1363 > #ifdef _WIN32
1364                  printf("\tdel %s\n", fn);
1365   #else
1366                  printf("\trm -f %s\n", fn);
# Line 1390 | Line 1391 | register char  *path;
1391          for (i = 0, psep = -1; path[i]; i++)
1392                  if (path[i] == '/')
1393                          psep = i;
1394 <        if (df != NULL)
1394 >        if (df != NULL) {
1395                  if (psep == 0) {
1396                          df[0] = '/';
1397                          df[1] = '\0';
# Line 1399 | Line 1400 | register char  *path;
1400                          df[psep] = '\0';
1401                  } else
1402                          df[0] = '\0';
1403 +        }
1404          return(path+psep+1);
1405   }
1406  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines