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.4 by greg, Fri Mar 12 13:37:03 1993 UTC vs.
Revision 2.7 by greg, Tue Apr 6 17:21:04 1993 UTC

# Line 94 | Line 94 | int    (*setqopts[3])() = {lowqopts, medqopts, hiqopts};
94  
95   #define renderopts      (*setqopts[vscale(QUALITY)])
96  
97 +                                /* overture calculation file */
98 + #ifdef NIX
99 + char    overfile[] = "overture.raw";
100 + #else
101 + char    overfile[] = "/dev/null";
102 + #endif
103 +
104   extern long     fdate(), time();
105  
106   long    scenedate;              /* date of latest scene or object file */
# Line 159 | Line 166 | char   *argv[];
166                                  /* print all values if requested */
167          if (explicate)
168                  printvals();
169 <                                /* run simulation */
169 >                                /* build octree */
170          oconv();
171 +                                /* check date on ambient file */
172 +        checkambfile();
173 +                                /* run simulation */
174          renderopts(ropts);
175          xferopts(ropts);
176          if (rvdevice != NULL)
# Line 547 | Line 557 | register char  *oo;
557   }
558  
559  
560 + checkambfile()                  /* check date on ambient file */
561 + {
562 +        long    afdate;
563 +
564 +        if (vdef(AMBFILE)) {
565 +                afdate = fdate(vval(AMBFILE));
566 +                if (afdate >= 0 & octreedate > afdate)
567 +                        rmfile(vval(AMBFILE));
568 +        }
569 + }
570 +
571 +
572   double
573   ambval()                                /* compute ambient value */
574   {
# Line 664 | Line 686 | register char  *op;
686          else
687                  op = addarg(op, "-ds .3");
688          op = addarg(op, "-dt .1 -dc .5 -dr 1 -sj .7 -st .15");
689 <        sprintf(op, " -ab %d", overture=vint(INDIRECT));
690 <        op += strlen(op);
689 >        if (overture = vint(INDIRECT)) {
690 >                sprintf(op, " -ab %d", overture);
691 >                op += strlen(op);
692 >        }
693          if (vdef(AMBFILE)) {
694                  sprintf(op, " -af %s", vval(AMBFILE));
695                  op += strlen(op);
# Line 1020 | Line 1044 | char   *opts;
1044                  else
1045                          badvalue(REPORT);
1046          }
1023                                        /* check date on ambient file */
1024        if (vdef(AMBFILE)) {
1025                long    afdate = fdate(vval(AMBFILE));
1026                if (afdate >= 0 & octreedate > afdate)
1027                        rmfile(vval(AMBFILE));
1028        }
1047                                          /* do each view */
1048          vn = 0;
1049          while ((vw = getview(vn++, vs)) != NULL) {
# Line 1045 | Line 1063 | char   *opts;
1063                                  sprintf(combuf,
1064                                  "rpict%s %s%s -x 64 -y 64 -ps 1 %s > %s",
1065                                                  rep, vw, opts,
1066 <                                                vval(OCTREE), rawfile);
1066 >                                                vval(OCTREE), overfile);
1067                                  if (runcom(combuf)) {
1068                                          fprintf(stderr,
1069 <                        "%s: error in overture for view %s\n\t%s removed\n",
1070 <                                                progname, vs, rawfile);
1053 <                                        unlink(rawfile);
1069 >                                        "%s: error in overture for view %s\n",
1070 >                                                progname, vs);
1071                                          exit(1);
1072                                  }
1073 + #ifdef NIX
1074 +                                rmfile(overfile);
1075 + #endif
1076                          }
1077                          sprintf(combuf, "rpict%s %s %s%s %s > %s",
1078                                          rep, vw, res, opts,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines