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

Comparing ray/src/gen/gendaymtx.c (file contents):
Revision 2.21 by greg, Wed Sep 2 22:52:04 2015 UTC vs.
Revision 2.22 by greg, Fri Oct 30 17:06:34 2015 UTC

# Line 323 | Line 323 | main(int argc, char *argv[])
323          int     ntsteps = 0;            /* number of rows in matrix */
324          int     step_alloc = 0;
325          int     last_monthly = 0;       /* month of last report */
326 +        int     inconsistent = 0;       /* inconsistent options set? */
327          int     mo, da;                 /* month (1-12) and day (1-31) */
328          double  hr;                     /* hour (local standard time) */
329          double  dir, dif;               /* direct and diffuse values */
# Line 373 | Line 374 | main(int argc, char *argv[])
374                          rhsubdiv = atoi(argv[++i]);
375                          break;
376                  case 'c':                       /* sky color */
377 +                        inconsistent |= (skycolor[1] <= 1e-4);
378                          skycolor[0] = atof(argv[++i]);
379                          skycolor[1] = atof(argv[++i]);
380                          skycolor[2] = atof(argv[++i]);
381                          break;
382                  case 'd':                       /* solar (direct) only */
383                          skycolor[0] = skycolor[1] = skycolor[2] = 0;
384 <                        if (suncolor[1] <= 1e-4)
384 >                        if (suncolor[1] <= 1e-4) {
385 >                                inconsistent = 1;
386                                  suncolor[0] = suncolor[1] = suncolor[2] = 1;
387 +                        }
388                          break;
389                  case 's':                       /* sky only (no direct) */
390                          suncolor[0] = suncolor[1] = suncolor[2] = 0;
391 <                        if (skycolor[1] <= 1e-4)
391 >                        if (skycolor[1] <= 1e-4) {
392 >                                inconsistent = 1;
393                                  skycolor[0] = skycolor[1] = skycolor[2] = 1;
394 +                        }
395                          break;
396                  case 'r':                       /* rotate distribution */
397                          if (argv[i][2] && argv[i][2] != 'z')
# Line 407 | Line 413 | main(int argc, char *argv[])
413                  }
414          if (i < argc-1)
415                  goto userr;
416 +        if (inconsistent)
417 +                fprintf(stderr, "%s: WARNING: inconsistent -s, -d, -c options!\n",
418 +                                progname);
419          if (i == argc-1 && freopen(argv[i], "r", stdin) == NULL) {
420                  fprintf(stderr, "%s: cannot open '%s' for input\n",
421                                  progname, argv[i]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines