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.15 by greg, Tue Jun 17 18:51:47 2014 UTC vs.
Revision 2.19 by greg, Tue Dec 30 20:35:34 2014 UTC

# Line 88 | Line 88 | static const char RCSid[] = "$Id$";
88   #include "rtmath.h"
89   #include "platform.h"
90   #include "color.h"
91 + #include "resolu.h"
92  
93   char *progname;                                                         /* Program name */
94   char errmsg[128];                                                       /* Error message buffer */
# Line 319 | Line 320 | main(int argc, char *argv[])
320          int     dir_is_horiz;           /* direct is meas. on horizontal? */
321          float   *mtx_data = NULL;       /* our matrix data */
322          int     ntsteps = 0;            /* number of rows in matrix */
323 +        int     step_alloc = 0;
324          int     last_monthly = 0;       /* month of last report */
325          int     mo, da;                 /* month (1-12) and day (1-31) */
326          double  hr;                     /* hour (local standard time) */
# Line 391 | Line 393 | main(int argc, char *argv[])
393                          break;
394                  case '5':                       /* 5-phase calculation */
395                          nsuns = 1;
396 <                        fixed_sun_sa = 6.797e-05;
396 >                        fixed_sun_sa = PI/360.*atof(argv[++i]);
397 >                        fixed_sun_sa *= fixed_sun_sa*PI;
398                          break;
399                  default:
400                          goto userr;
# Line 457 | Line 460 | main(int argc, char *argv[])
460          s_meridian = DegToRad(s_meridian);
461                                          /* process each time step in tape */
462          while (scanf("%d %d %lf %lf %lf\n", &mo, &da, &hr, &dir, &dif) == 5) {
460                static int      step_alloc = 0;
463                  double          sda, sta;
464                                          /* make space for next time step */
465                  mtx_offset = 3*nskypatch*ntsteps++;
466                  if (ntsteps > step_alloc) {
467 <                        step_alloc += step_alloc>>1 + 8;
467 >                        step_alloc += (step_alloc>>1) + ntsteps + 7;
468                          mtx_data = resize_dmatrix(mtx_data, step_alloc, nskypatch);
469                  }
470                  if (dif <= 1e-4) {
# Line 519 | Line 521 | main(int argc, char *argv[])
521                  printf("NROWS=%d\n", nskypatch);
522                  printf("NCOLS=%d\n", ntsteps);
523                  printf("NCOMP=3\n");
524 <                fputformat(getfmtname(outfmt), stdout);
524 >                fputformat((char *)getfmtname(outfmt), stdout);
525                  putchar('\n');
526          }
527                                          /* patches are rows (outer sort) */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines