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.51 by greg, Tue Feb 28 03:44:54 2006 UTC vs.
Revision 2.60 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 23 | Line 23 | static const char RCSid[] = "$Id$";
23  
24   #include "platform.h"
25   #include "rtprocess.h"
26 #include "paths.h"
26   #include "standard.h"
27   #include "view.h"
28   #include "vars.h"
# Line 67 | Line 66 | int    NVARS = 24;             /* total number of variables */
66   VARIABLE        vv[] = {                /* variable-value pairs */
67          {"ANIMATE",     2,      0,      NULL,   onevalue},
68          {"ARCHIVE",     2,      0,      NULL,   onevalue},
69 <        {"BASENAME",    3,      0,      NULL,   onevalue},
69 >        {"BASENAME",    3,      0,      NULL,   strvalue},
70          {"DBLUR",       2,      0,      NULL,   onevalue},
71 <        {"DIRECTORY",   3,      0,      NULL,   onevalue},
71 >        {"DIRECTORY",   3,      0,      NULL,   strvalue},
72          {"DISKSPACE",   3,      0,      NULL,   fltvalue},
73          {"END",         2,      0,      NULL,   intvalue},
74          {"EXPOSURE",    3,      0,      NULL,   onevalue},
75          {"host",        4,      0,      NULL,   NULL},
76          {"INTERPOLATE", 3,      0,      NULL,   intvalue},
77          {"MBLUR",       2,      0,      NULL,   onevalue},
78 <        {"NEXTANIM",    3,      0,      NULL,   onevalue},
79 <        {"OCTREE",      3,      0,      NULL,   onevalue},
78 >        {"NEXTANIM",    3,      0,      NULL,   strvalue},
79 >        {"OCTREE",      3,      0,      NULL,   strvalue},
80          {"OVERSAMPLE",  2,      0,      NULL,   fltvalue},
81          {"pfilt",       2,      0,      NULL,   catvalues},
82          {"pinterp",     2,      0,      NULL,   catvalues},
83          {"render",      3,      0,      NULL,   catvalues},
84          {"RESOLUTION",  3,      0,      NULL,   onevalue},
85 <        {"RIF",         3,      0,      NULL,   onevalue},
85 >        {"RIF",         3,      0,      NULL,   strvalue},
86          {"RSH",         3,      0,      NULL,   onevalue},
87          {"RTRACE",      2,      0,      NULL,   boolvalue},
88          {"START",       2,      0,      NULL,   intvalue},
89          {"TRANSFER",    2,      0,      NULL,   onevalue},
90 <        {"VIEWFILE",    2,      0,      NULL,   onevalue},
90 >        {"VIEWFILE",    2,      0,      NULL,   strvalue},
91   };
92  
93   #define SFNAME  "STATUS"                /* status file name */
# Line 102 | Line 101 | struct {
101          int     tnext;                  /* next frame to transfer */
102   }       astat;                  /* animation status */
103  
105 char    *progname;              /* our program name */
104   char    *cfname;                /* our control file name */
105  
106   int     nowarn = 0;             /* turn warnings off? */
# Line 169 | Line 167 | main(
167   {
168          int     explicate = 0;
169          int     i;
170 <
171 <        progname = argv[0];                     /* get arguments */
170 >                                                /* set global progname */
171 >        fixargv0(argv[0]);
172 >                                                /* get arguments */
173          for (i = 1; i < argc && argv[i][0] == '-'; i++)
174                  switch (argv[i][1]) {
175                  case 'e':                       /* print variables */
# Line 416 | Line 415 | setdefaults(void)                      /* set default values */
415          if (!vdef(DISKSPACE)) {
416                  if (!nowarn)
417                          fprintf(stderr,
418 <                "%s: warning - no %s setting, assuming 100 Mbytes available\n",
418 >                "%s: warning - no %s setting, assuming 1000 Mbytes available\n",
419                                          progname, vnam(DISKSPACE));
420 <                vval(DISKSPACE) = "100";
420 >                vval(DISKSPACE) = "1000";
421                  vdef(DISKSPACE)++;
422          }
423          if (!vdef(RSH)) {
# Line 708 | Line 707 | transferframes(void)                   /* catch up with picture transf
707                  *cp++ = ' ';
708                  sprintf(cp, fbase, i);
709                  while (*cp) cp++;
710 <                strcpy(cp, ".pic");
710 >                strcpy(cp, ".hdr");
711                  cp += 4;
712          }
713          if (runcom(combuf)) {           /* transfer frames */
# Line 946 | Line 945 | int    rvr
945                  usepfilt |= nora_rgbe;
946          } else if (frseq[0] == frame) {         /* no interpolation needed */
947                  if (!rvr && frame > 1+vint(INTERP)) {   /* archive previous */
948 +                        if (arcnext - arcargs +
949 +                                        strlen(fbase) >= sizeof(arcargs)-8) {
950 +                                fprintf(stderr,
951 + "%s: too many filenames in archive command -- reduce %s variable\n",
952 +                                                progname, vnam(DISKSPACE));
953 +                                quit(1);
954 +                        }
955                          *arcnext++ = ' ';
956                          sprintf(arcnext, fbase, frame-vint(INTERP)-1);
957                          while (*arcnext) arcnext++;
# Line 1054 | Line 1060 | int    rvr
1060          }
1061                                                  /* output file name */
1062          sprintf(fname0, vval(BASENAME), frame);
1063 <        sprintf(combuf+strlen(combuf), " > %s.pic", fname0);
1063 >        sprintf(combuf+strlen(combuf), " > %s.hdr", fname0);
1064          if (rvr)                                /* in recovery */
1065                  return(runcom(combuf));
1066          bruncom(combuf, frame, frecover);       /* else run in background */
# Line 1127 | Line 1133 | countviews(void)                       /* count views in view file */
1133   static char *
1134   getexp(int n)                   /* get exposure for nth frame */
1135   {
1130        extern char     *fskip();
1136          static char     expval[32];
1137          static FILE     *expfp = NULL;
1138          static long     *exppos;
# Line 1406 | Line 1411 | static int
1411   rmfile(char *fn)                        /* remove a file */
1412   {
1413          if (!silent)
1414 < #ifdef _WIN32
1414 > #if defined(_WIN32) || defined(_WIN64)
1415                  printf("\tdel %s\n", fn);
1416   #else
1417                  printf("\trm -f %s\n", fn);
# Line 1459 | Line 1464 | getblur(double *mbf, double *dbf)      /* get # blur sample
1464          int     nmblur, ndblur;
1465          char    *s;
1466                                          /* get motion blur */
1467 <        if (!vdef(MBLUR) || (mblurf = atof(vval(MBLUR))) < 0.0)
1467 >        if (vdef(ANIMATE) || !vdef(MBLUR) || (mblurf = atof(vval(MBLUR))) < 0.0)
1468                  mblurf = 0.0;
1469          if (mbf != NULL)
1470                  *mbf = mblurf;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines