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

Comparing ray/src/util/rad.c (file contents):
Revision 2.42 by greg, Fri Dec 23 09:20:06 1994 UTC vs.
Revision 2.43 by greg, Thu Jul 6 12:15:40 1995 UTC

# Line 49 | Line 49 | int    onevalue(), catvalues(), boolvalue(),
49   #define PENUMBRAS       20              /* shadow penumbras are desired */
50   #define VARIABILITY     21              /* level of light variability */
51   #define REPORT          22              /* report frequency and errfile */
52 + #define RAWSAVE         23              /* save raw picture file */
53                                  /* total number of variables */
54 < #define NVARS           23
54 > #define NVARS           24
55  
56   VARIABLE        vv[NVARS] = {           /* variable-value pairs */
57          {"objects",     3,      0,      NULL,   catvalues},
# Line 76 | Line 77 | VARIABLE       vv[NVARS] = {           /* variable-value pairs */
77          {"PENUMBRAS",   3,      0,      NULL,   boolvalue},
78          {"VARIABILITY", 3,      0,      NULL,   qualvalue},
79          {"REPORT",      3,      0,      NULL,   onevalue},
80 +        {"RAWSAVE",     3,      0,      NULL,   boolvalue},
81   };
82  
83   VARIABLE        *matchvar();
# Line 647 | Line 649 | setdefaults()                  /* set default values for unassigned v
649                  vval(VARIABILITY) = "L";
650                  vdef(VARIABILITY)++;
651          }
652 +        if (!vdef(RAWSAVE)) {
653 +                vval(RAWSAVE) = "F";
654 +                vdef(RAWSAVE)++;
655 +        }
656   }
657  
658  
# Line 1493 | Line 1499 | char   *opts, *po;
1499                          unlink(picfile);
1500                          exit(1);
1501                  }
1502 <                                                /* remove raw file */
1503 <                rmfile(rawfile);
1502 >                                                /* remove/rename raw file */
1503 >                if (vbool(RAWSAVE)) {
1504 >                        sprintf(combuf, "%s_%s.rwp", vval(PICTURE), vs);
1505 >                        mvfile(rawfile, combuf);
1506 >                } else
1507 >                        rmfile(rawfile);
1508          }
1509   }
1510  
# Line 1539 | Line 1549 | char   *fn;
1549          if (noaction)
1550                  return(0);
1551          return(unlink(fn));
1552 + }
1553 +
1554 +
1555 + mvfile(fold, fnew)              /* move a file */
1556 + char    *fold, *fnew;
1557 + {
1558 +        if (!silent)
1559 + #ifdef MSDOS
1560 +                printf("\trename %s %s\n", fold, fnew);
1561 + #else
1562 +                printf("\tmv %s %s\n", fold, fnew);
1563 + #endif
1564 +        if (noaction)
1565 +                return(0);
1566 +        return(rename(fold, fnew));
1567   }
1568  
1569  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines