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

Comparing ray/src/util/dctimestep.c (file contents):
Revision 2.35 by greg, Fri Sep 26 23:33:09 2014 UTC vs.
Revision 2.37 by schorsch, Sun Mar 6 01:13:18 2016 UTC

# Line 8 | Line 8 | static const char RCSid[] = "$Id$";
8   */
9  
10   #include <ctype.h>
11 + #include "platform.h"
12   #include "standard.h"
13   #include "cmatrix.h"
14   #include "platform.h"
# Line 182 | Line 183 | main(int argc, char *argv[])
183                  goto userr;
184  
185          if (argc-a > 2) {                       /* VTDs expression */
186 <                CMATRIX *smtx, *Dmat, *Tmat, *imtx;
186 >                CMATRIX         *smtx, *Dmat, *Tmat, *imtx;
187 >                const char      *ccp;
188                                                  /* get sky vector/matrix */
189                  smtx = cm_load(argv[a+3], 0, nsteps, skyfmt);
190                  nsteps = smtx->ncols;
191                                                  /* load BSDF */
192 <                Tmat = cm_loadBTDF(argv[a+1]);
192 >                if (argv[a+1][0] != '!' &&
193 >                                (ccp = strrchr(argv[a+1], '.')) != NULL &&
194 >                                !strcasecmp(ccp+1, "XML"))
195 >                        Tmat = cm_loadBTDF(argv[a+1]);
196 >                else
197 >                        Tmat = cm_load(argv[a+1], 0, 0, DTfromHeader);
198                                                  /* load Daylight matrix */
199 <                Dmat = cm_load(argv[a+2], Tmat==NULL ? 0 : Tmat->ncols,
199 >                Dmat = cm_load(argv[a+2], Tmat->ncols,
200                                          smtx->nrows, DTfromHeader);
201                                                  /* multiply vector through */
202                  imtx = cm_multiply(Dmat, smtx);
# Line 319 | Line 326 | main(int argc, char *argv[])
326   userr:
327          fprintf(stderr, "Usage: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d}] DCspec [skyf]\n",
328                                  progname);
329 <        fprintf(stderr, "   or: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d}] Vspec Tbsdf.xml Dmat.dat [skyf]\n",
329 >        fprintf(stderr, "   or: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d}] Vspec Tbsdf Dmat.dat [skyf]\n",
330                                  progname);
331          return(1);
332   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines