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 1.11 by greg, Wed Aug 29 21:56:17 1990 UTC vs.
Revision 2.3 by greg, Mon Aug 24 15:19:12 1992 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19   #include  "otypes.h"
20  
21 + #ifndef  DEFPATH
22 + #define  DEFPATH        ":/usr/local/lib/ray"
23 + #endif
24 +
25   #define  OMARGIN        (10*FTINY)      /* margin around global cube */
26  
27   #define  MAXOBJFIL      63              /* maximum number of scene files */
# Line 46 | Line 50 | main(argc, argv)               /* convert object files to an octree
50   int  argc;
51   char  **argv;
52   {
53 <        char  *getenv();
50 <        double  atof();
53 >        extern char  *getenv();
54          FVECT  bbmin, bbmax;
55          char  *infile = NULL;
56          int  outflags = IO_ALL;
# Line 57 | Line 60 | char  **argv;
60          progname = argv[0];
61  
62          if ((libpath = getenv("RAYPATH")) == NULL)
63 <                libpath = ":/usr/local/lib/ray";
63 >                libpath = DEFPATH;
64  
65 +        initotypes();
66 +
67          for (i = 1; i < argc && argv[i][0] == '-'; i++)
68                  switch (argv[i][1]) {
69                  case '\0':                              /* scene from stdin */
# Line 101 | Line 106 | breakopt:
106          }
107  
108          printargs(argc, argv, stdout);  /* info. header */
109 +        fputformat(OCTFMT, stdout);
110          printf("\n");
111  
112          startobj = nobjects;            /* previous objects already converted */
# Line 205 | Line 211 | OBJECT  obj;
211          CUBE  cukid;
212          OCTREE  ot;
213          OBJECT  oset[MAXSET+1];
214 <        unsigned char  inflg[MAXSET/8], volflg[MAXSET/8];
214 >        unsigned char  inflg[(MAXSET+7)/8], volflg[(MAXSET+7)/8];
215          int  in;
216          register int  i, j;
217  
# Line 242 | Line 248 | OBJECT  obj;
248          if (in==O_IN || oset[0] < objlim || cukid.cusize < mincusize) {
249                                                  /* add to set */
250                  if (oset[0] >= MAXSET) {
251 <                        sprintf(errmsg,
246 <                                "set overflow in addobject (%s)",
251 >                        sprintf(errmsg, "set overflow in addobject (%s)",
252                                          objptr(obj)->oname);
253                          error(INTERNAL, errmsg);
254                  }
# Line 262 | Line 267 | OBJECT  obj;
267                  if (isvolume(objptr(oset[j])->otype)) {
268                          setbit(volflg,j-1);
269                          if ((*ofun[objptr(oset[j])->otype].funp)
270 <                                        (objptr(oset[j]),cu) == O_IN)
270 >                                        (objptr(oset[j]), cu) == O_IN)
271                                  setbit(inflg,j-1);
272                  }
273                                          /* assign subcubes */
# Line 279 | Line 284 | OBJECT  obj;
284                                  addobject(&cukid, oset[j]);
285                                          /* then this object */
286                  addobject(&cukid, obj);
287 <                                        /* partial volumes */
287 >                                        /* then partial volumes */
288                  for (j = 1; j <= oset[0]; j++)
289                          if (tstbit(volflg,j-1) &&
290                                          !tstbit(inflg,j-1))
291                                  addobject(&cukid, oset[j]);
292 <                                        /* full volumes */
292 >                                        /* full volumes last */
293                  for (j = 1; j <= oset[0]; j++)
294                          if (tstbit(inflg,j-1))
295                                  addobject(&cukid, oset[j]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines