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

Comparing ray/src/ot/oconv.c (file contents):
Revision 2.19 by schorsch, Sat Mar 27 12:41:45 2004 UTC vs.
Revision 2.25 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 12 | Line 12 | static const char RCSid[] = "$Id$";
12   #include  "octree.h"
13   #include  "object.h"
14   #include  "otypes.h"
15 #include  "paths.h"
15   #include  "resolu.h"
16   #include  "oconv.h"
17  
18   #define  OMARGIN        (10*FTINY)      /* margin around global cube */
19  
20 < #define  MAXOBJFIL      127             /* maximum number of scene files */
20 > #define  MAXOBJFIL      255             /* maximum number of scene files */
21  
23 char  *progname;                        /* argv[0] */
24
22   int  nowarn = 0;                        /* supress warnings? */
23  
24   int  objlim = 6;                        /* # of objects before split */
25  
26   int  resolu = 16384;                    /* octree resolution limit */
27  
28 < CUBE  thescene = {EMPTY, {0.0, 0.0, 0.0}, 0.0};         /* our scene */
28 > CUBE  thescene = {{0.0, 0.0, 0.0}, 0.0, EMPTY};         /* our scene */
29  
30   char  *ofname[MAXOBJFIL+1];             /* object file names */
31   int  nfiles = 0;                        /* number of object files */
# Line 54 | Line 51 | main(          /* convert object files to an octree */
51          OBJECT  startobj;
52          int  i;
53  
54 <        progname = argv[0] = fixargv0(argv[0]);
54 >        fixargv0(argv[0]);              /* sets global progname */
55  
56          ot_initotypes();
57  
# Line 178 | Line 175 | cputs(void)                                    /* interactive error */
175  
176   void
177   wputs(                          /* warning message */
178 <        char  *s
178 >        const char  *s
179   )
180   {
181          if (!nowarn)
# Line 188 | Line 185 | wputs(                         /* warning message */
185  
186   void
187   eputs(                          /* put string to stderr */
188 <        register char  *s
188 >        const char  *s
189   )
190   {
191          static int  inln = 0;
# Line 217 | Line 214 | eputs(                         /* put string to stderr */
214  
215   static void
216   addobject(                      /* add an object to a cube */
217 <        register CUBE  *cu,
217 >        CUBE  *cu,
218          OBJECT  obj
219   )
220   {
# Line 257 | Line 254 | addobject(                     /* add an object to a cube */
254  
255   static void
256   add2full(                       /* add object to full node */
257 <        register CUBE  *cu,
257 >        CUBE  *cu,
258          OBJECT  obj,
259          int  inc
260   )
# Line 266 | Line 263 | add2full(                      /* add object to full node */
263          OBJECT  oset[MAXSET+1];
264          CUBE  cukid;
265          unsigned char  inflg[(MAXSET+7)/8], volflg[(MAXSET+7)/8];
266 <        register int  i, j;
266 >        int  i, j;
267  
268          objset(oset, cu->cutree);
269          cukid.cusize = cu->cusize * 0.5;
270  
271 <        if (inc==O_IN || oset[0] < objlim || cukid.cusize < mincusize) {
271 >        if (inc==O_IN || oset[0] < objlim || cukid.cusize <
272 >                        (oset[0] < MAXSET ? mincusize : mincusize/256.0)) {
273                                                  /* add to set */
274                  if (oset[0] >= MAXSET) {
275                          sprintf(errmsg, "set overflow in addobject (%s)",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines