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

Comparing ray/src/util/rtcontrib.c (file contents):
Revision 1.14 by greg, Thu Jun 9 17:27:28 2005 UTC vs.
Revision 1.20 by greg, Fri Jun 10 20:53:55 2005 UTC

# Line 16 | Line 16 | static const char RCSid[] = "$Id$";
16   #include  "lookup.h"
17   #include  "calcomp.h"
18  
19 + #ifndef MAXMODLIST
20   #define MAXMODLIST      1024            /* maximum modifiers we'll track */
21 + #endif
22  
23   int     treebufsiz = BUFSIZ;            /* current tree buffer size */
24  
# Line 72 | Line 74 | struct rtproc {
74   };                              /* rtrace process buffer */
75  
76                                          /* rtrace command and defaults */
77 < char            *rtargv[256] = { "rtrace", "-dj", ".5", "-dr", "3",
77 > char            *rtargv[256+2*MAXMODLIST] = { "rtrace",
78 >                                "-dj", ".5", "-dr", "3",
79                                  "-ab", "1", "-ad", "128", };
80   int  rtargc = 9;
81                                          /* overriding rtrace options */
# Line 110 | Line 113 | const char     *modname[MAXMODLIST];   /* ordered modifier n
113   int             nmods = 0;              /* number of modifiers */
114  
115   MODCONT *addmodifier(char *modn, char *outf, char *binv);
116 + void addmodfile(char *fname, char *outf, char *binv);
117  
118   void init(int np);
119   int done_rprocs(struct rtproc *rtp);
# Line 257 | Line 261 | main(int argc, char *argv[])
261                                  rtargv[rtargc++] = argv[++i];
262                                  addmodifier(argv[i], curout, binval);
263                                  continue;
264 +                        case 'M':               /* modifier file */
265 +                                if (argv[i][2] || i >= argc-1) break;
266 +                                rtargv[rtargc++] = "-tI";
267 +                                rtargv[rtargc++] = argv[++i];
268 +                                addmodfile(argv[i], curout, binval);
269 +                                continue;
270                          }
271                  rtargv[rtargc++] = argv[i];     /* assume rtrace option */
272          }
# Line 452 | Line 462 | addmodifier(char *modn, char *outf, char *binv)
462          return mp;
463   }
464  
465 + /* add modifiers from a file list */
466 + void
467 + addmodfile(char *fname, char *outf, char *binv)
468 + {
469 +        char    *mname[MAXMODLIST];
470 +        int     i;
471 +                                        /* find the file & store strings */
472 +        if (wordfile(mname, getpath(fname, getrlibpath(), R_OK)) < 0) {
473 +                sprintf(errmsg, "cannot find modifier file '%s'", fname);
474 +                error(SYSTEM, errmsg);
475 +        }
476 +        for (i = 0; mname[i]; i++)      /* add each one */
477 +                addmodifier(mname[i], outf, binv);
478 + }
479 +
480   /* put string to stderr */
481   void
482   eputs(char  *s)
# Line 1045 | Line 1070 | recover_output(FILE *fin)
1070                                  break;          /* no bin separation */
1071                  }
1072                  if (!lastout) {                 /* empty output */
1073 <                        error(WARNING, "no data to recover");
1073 >                        error(WARNING, "no previous data to recover");
1074                          lu_done(&ofiletab);     /* reclose all outputs */
1075                          return;
1076                  }
# Line 1058 | Line 1083 | recover_output(FILE *fin)
1083                          mp->nbins = j;
1084                          ment->data = (char *)mp;
1085                  }
1086 +        }
1087 +        if (lastout < 0) {
1088 +                error(WARNING, "no output files to recover");
1089 +                return;
1090          }
1091                                                  /* seek on all files */
1092          nvals = lastout * outvsiz;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines