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

Comparing ray/src/gen/mksource.c (file contents):
Revision 2.11 by greg, Fri Nov 17 20:02:07 2023 UTC vs.
Revision 2.13 by greg, Tue Jun 3 21:31:51 2025 UTC

# Line 7 | Line 7 | static const char RCSid[] = "$Id$";
7  
8   #include "ray.h"
9   #include "random.h"
10 + #include "paths.h"
11   #include "resolu.h"
12  
13   #define NTRUNKBR        4               /* number of branches at trunk */
# Line 29 | Line 30 | typedef struct lostlight {
30          COLOR           intens;         /* output times solid angle */
31   } LOSTLIGHT;
32  
32 extern char     *progname;
33
33   FVECT   scene_cent;             /* center of octree cube */
34   RREAL   scene_rad;              /* radius to get outside cube from center */
35  
# Line 185 | Line 184 | branchsample(TRITREE *node, int depth)
184  
185   /* Sample sphere using triangular geodesic mesh */
186   TRITREE *
187 < geosample(int nsamps)
187 > geosample(long nsamps)
188   {
189          int     depth;
190          TRITREE *tree;
# Line 194 | Line 193 | geosample(int nsamps)
193                                          /* figure out depth */
194          if ((nsamps -= 4) < 0)
195                  error(USER, "minimum number of samples is 4");
196 <        nsamps = nsamps*3/NTRUNKBR;     /* round up */
196 >        nsamps = nsamps*(NTRUNKBR-1)/NTRUNKBR;  /* round up */
197          for (depth = 0; nsamps > 1; depth++)
198                  nsamps >>= 2;
199                                          /* make base tetrahedron */
# Line 502 | Line 501 | main(int argc, char *argv[])
501          TRITREE *samptree;
502          double  thresh = 0;
503          int     i;
504 <        
505 <        progname = argv[0];
504 >
505 >        fixargv0(argv[0]);              /* sets global progname */
506 >
507          for (i = 1; i < argc && argv[i][0] == '-'; i++)
508                  switch (argv[i][1]) {
509                  case 'd':               /* number of samples */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines