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

Comparing ray/src/ot/obj2mesh.c (file contents):
Revision 2.15 by greg, Fri Mar 3 01:25:27 2017 UTC vs.
Revision 2.19 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 6 | Line 6 | static const char RCSid[] = "$Id$";
6   */
7  
8   #include "copyright.h"
9 < #include "paths.h"
9 >
10   #include "platform.h"
11   #include "standard.h"
12   #include "resolu.h"
# Line 19 | Line 19 | int    o_default() { return(O_MISS); }
19  
20   FUN  ofun[NUMOTYPE] = INIT_OTYPE;       /* needed for link resolution */
21  
22 char  *progname;                        /* argv[0] */
23
22   int  nowarn = 0;                        /* supress warnings? */
23  
24   int  objlim = 9;                        /* # of objects before split */
# Line 39 | Line 37 | main(          /* compile a .OBJ file into a mesh */
37          char  *argv[]
38   )
39   {
42        int  nmatf = 0;
40          int  verbose = 0;
44        char  pathnames[12800];
45        char  *pns = pathnames;
46        char  *matinp[128];
41          char  *cp;
42          int  i, j;
43  
44 <        progname = argv[0];
44 >        fixargv0(argv[0]);              /* sets global progname */
45 >
46          ofun[OBJ_FACE].funp = o_face;
47  
48          for (i = 1; i < argc && argv[i][0] == '-'; i++)
# Line 59 | Line 54 | main(          /* compile a .OBJ file into a mesh */
54                          resolu = atoi(argv[++i]);
55                          break;
56                  case 'a':                               /* material file */
57 <                        matinp[nmatf++] = argv[++i];
57 >                        readobj(argv[++i]);
58                          break;
59                  case 'l':                               /* library material */
60                          cp = getpath(argv[++i], getrlibpath(), R_OK);
# Line 69 | Line 64 | main(          /* compile a .OBJ file into a mesh */
64                                                  argv[i]);
65                                  error(SYSTEM, errmsg);
66                          }
67 <                        matinp[nmatf++] = strcpy(pns, cp);
73 <                        while (*pns++)
74 <                                ;
67 >                        readobj(cp);
68                          break;
69                  case 'w':                               /* supress warnings */
70                          nowarn = 1;
# Line 89 | Line 82 | main(          /* compile a .OBJ file into a mesh */
82                  error(USER, "too many file arguments");
83                                          /* initialize mesh */
84          cvinit(i==argc-2 ? argv[i+1] : "<stdout>");
92                                        /* load material input */
93        for (j = 0; j < nmatf; j++)
94                readobj(matinp[j]);
85                                          /* read .OBJ file into triangles */
86          if (i == argc)
87                  wfreadobj(NULL);
# Line 151 | Line 141 | cputs(void)                                    /* interactive error */
141  
142   void
143   wputs(                          /* warning message */
144 <        char  *s
144 >        const char  *s
145   )
146   {
147          if (!nowarn)
# Line 161 | Line 151 | wputs(                         /* warning message */
151  
152   void
153   eputs(                          /* put string to stderr */
154 <        register char  *s
154 >        const char  *s
155   )
156   {
157          static int  inln = 0;
# Line 178 | Line 168 | eputs(                         /* put string to stderr */
168  
169   static void
170   addface(                        /* add a face to a cube */
171 <        register CUBE  *cu,
171 >        CUBE  *cu,
172          OBJECT  obj
173   )
174   {
# Line 215 | Line 205 | addface(                       /* add a face to a cube */
205  
206   static void
207   add2full(                       /* add object to full node */
208 <        register CUBE  *cu,
208 >        CUBE  *cu,
209          OBJECT  obj
210   )
211   {
212          OCTREE  ot;
213          OBJECT  oset[MAXSET+1];
214          CUBE  cukid;
215 <        register int  i, j;
215 >        int  i, j;
216  
217          objset(oset, cu->cutree);
218          cukid.cusize = cu->cusize * 0.5;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines