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.50 by schorsch, Mon Sep 12 14:40:14 2005 UTC vs.
Revision 2.58 by greg, Sat Jun 10 15:49:55 2023 UTC

# Line 67 | Line 67 | int    NVARS = 24;             /* total number of variables */
67   VARIABLE        vv[] = {                /* variable-value pairs */
68          {"ANIMATE",     2,      0,      NULL,   onevalue},
69          {"ARCHIVE",     2,      0,      NULL,   onevalue},
70 <        {"BASENAME",    3,      0,      NULL,   onevalue},
70 >        {"BASENAME",    3,      0,      NULL,   strvalue},
71          {"DBLUR",       2,      0,      NULL,   onevalue},
72 <        {"DIRECTORY",   3,      0,      NULL,   onevalue},
72 >        {"DIRECTORY",   3,      0,      NULL,   strvalue},
73          {"DISKSPACE",   3,      0,      NULL,   fltvalue},
74          {"END",         2,      0,      NULL,   intvalue},
75          {"EXPOSURE",    3,      0,      NULL,   onevalue},
76          {"host",        4,      0,      NULL,   NULL},
77          {"INTERPOLATE", 3,      0,      NULL,   intvalue},
78          {"MBLUR",       2,      0,      NULL,   onevalue},
79 <        {"NEXTANIM",    3,      0,      NULL,   onevalue},
80 <        {"OCTREE",      3,      0,      NULL,   onevalue},
79 >        {"NEXTANIM",    3,      0,      NULL,   strvalue},
80 >        {"OCTREE",      3,      0,      NULL,   strvalue},
81          {"OVERSAMPLE",  2,      0,      NULL,   fltvalue},
82          {"pfilt",       2,      0,      NULL,   catvalues},
83          {"pinterp",     2,      0,      NULL,   catvalues},
84          {"render",      3,      0,      NULL,   catvalues},
85          {"RESOLUTION",  3,      0,      NULL,   onevalue},
86 <        {"RIF",         3,      0,      NULL,   onevalue},
86 >        {"RIF",         3,      0,      NULL,   strvalue},
87          {"RSH",         3,      0,      NULL,   onevalue},
88          {"RTRACE",      2,      0,      NULL,   boolvalue},
89          {"START",       2,      0,      NULL,   intvalue},
90          {"TRANSFER",    2,      0,      NULL,   onevalue},
91 <        {"VIEWFILE",    2,      0,      NULL,   onevalue},
91 >        {"VIEWFILE",    2,      0,      NULL,   strvalue},
92   };
93  
94   #define SFNAME  "STATUS"                /* status file name */
# Line 218 | Line 218 | main(
218          animate();
219                                                  /* all done */
220          if (vdef(NEXTANIM)) {
221 +                char    *fullp;
222                  argv[i] = vval(NEXTANIM);       /* just change input file */
223                  if (!silent)
224                          printargs(argc, argv, stdout);
225 <                if ((argv[0] = getpath(progname,getenv("PATH"),X_OK)) == NULL)
226 <                        fprintf(stderr, "%s: command not found\n", progname);
225 >                fflush(stdout);
226 >                if ((fullp = getpath(argv[0],getenv("PATH"),X_OK)) == NULL)
227 >                        fprintf(stderr, "%s: command not found\n", argv[0]);
228                  else
229 <                        execv(progname, argv);
229 >                        execv(fullp, argv);
230                  quit(1);
231          }
232          quit(0);
233 <        return 0; /* pro forma return */
233 >        return(0); /* pro forma return */
234   userr:
235          fprintf(stderr, "Usage: %s [-s][-n][-w][-e] anim_file\n", progname);
236          quit(1);
# Line 414 | Line 416 | setdefaults(void)                      /* set default values */
416          if (!vdef(DISKSPACE)) {
417                  if (!nowarn)
418                          fprintf(stderr,
419 <                "%s: warning - no %s setting, assuming 100 Mbytes available\n",
419 >                "%s: warning - no %s setting, assuming 1000 Mbytes available\n",
420                                          progname, vnam(DISKSPACE));
421 <                vval(DISKSPACE) = "100";
421 >                vval(DISKSPACE) = "1000";
422                  vdef(DISKSPACE)++;
423          }
424          if (!vdef(RSH)) {
# Line 706 | Line 708 | transferframes(void)                   /* catch up with picture transf
708                  *cp++ = ' ';
709                  sprintf(cp, fbase, i);
710                  while (*cp) cp++;
711 <                strcpy(cp, ".pic");
711 >                strcpy(cp, ".hdr");
712                  cp += 4;
713          }
714          if (runcom(combuf)) {           /* transfer frames */
# Line 944 | Line 946 | int    rvr
946                  usepfilt |= nora_rgbe;
947          } else if (frseq[0] == frame) {         /* no interpolation needed */
948                  if (!rvr && frame > 1+vint(INTERP)) {   /* archive previous */
949 +                        if (arcnext - arcargs +
950 +                                        strlen(fbase) >= sizeof(arcargs)-8) {
951 +                                fprintf(stderr,
952 + "%s: too many filenames in archive command -- reduce %s variable\n",
953 +                                                progname, vnam(DISKSPACE));
954 +                                quit(1);
955 +                        }
956                          *arcnext++ = ' ';
957                          sprintf(arcnext, fbase, frame-vint(INTERP)-1);
958                          while (*arcnext) arcnext++;
# Line 1052 | Line 1061 | int    rvr
1061          }
1062                                                  /* output file name */
1063          sprintf(fname0, vval(BASENAME), frame);
1064 <        sprintf(combuf+strlen(combuf), " > %s.pic", fname0);
1064 >        sprintf(combuf+strlen(combuf), " > %s.hdr", fname0);
1065          if (rvr)                                /* in recovery */
1066                  return(runcom(combuf));
1067          bruncom(combuf, frame, frecover);       /* else run in background */
# Line 1125 | Line 1134 | countviews(void)                       /* count views in view file */
1134   static char *
1135   getexp(int n)                   /* get exposure for nth frame */
1136   {
1128        extern char     *fskip();
1137          static char     expval[32];
1138          static FILE     *expfp = NULL;
1139          static long     *exppos;
# Line 1404 | Line 1412 | static int
1412   rmfile(char *fn)                        /* remove a file */
1413   {
1414          if (!silent)
1415 < #ifdef _WIN32
1415 > #if defined(_WIN32) || defined(_WIN64)
1416                  printf("\tdel %s\n", fn);
1417   #else
1418                  printf("\trm -f %s\n", fn);
# Line 1457 | Line 1465 | getblur(double *mbf, double *dbf)      /* get # blur sample
1465          int     nmblur, ndblur;
1466          char    *s;
1467                                          /* get motion blur */
1468 <        if (!vdef(MBLUR) || (mblurf = atof(vval(MBLUR))) < 0.0)
1468 >        if (vdef(ANIMATE) || !vdef(MBLUR) || (mblurf = atof(vval(MBLUR))) < 0.0)
1469                  mblurf = 0.0;
1470          if (mbf != NULL)
1471                  *mbf = mblurf;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines