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

Comparing ray/src/ot/cvmesh.c (file contents):
Revision 2.8 by greg, Thu Jan 29 22:21:34 2004 UTC vs.
Revision 2.9 by schorsch, Sat Mar 27 12:41:45 2004 UTC

# Line 37 | Line 37 | MESH   *ourmesh = NULL;                /* our global mesh data structu
37  
38   FVECT   meshbounds[2];                  /* mesh bounding box */
39  
40 + static void add2bounds(FVECT vp, RREAL vc[2]);
41 + static OBJECT cvmeshtri(OBJECT obj);
42 + static OCTREE cvmeshoct(OCTREE ot);
43  
44 +
45 +
46   MESH *
47 < cvinit(nm)                      /* initialize empty mesh */
48 < char    *nm;
47 > cvinit(                 /* initialize empty mesh */
48 >        char    *nm
49 > )
50   {
51                                  /* free old mesh, first */
52          if (ourmesh != NULL) {
# Line 70 | Line 76 | nomem:
76  
77  
78   int
79 < cvpoly(mo, n, vp, vn, vc)       /* convert a polygon to extended triangles */
80 < OBJECT  mo;
81 < int     n;
82 < FVECT   *vp;
83 < FVECT   *vn;
84 < RREAL   (*vc)[2];
79 > cvpoly( /* convert a polygon to extended triangles */
80 >        OBJECT  mo,
81 >        int     n,
82 >        FVECT   *vp,
83 >        FVECT   *vn,
84 >        RREAL   (*vc)[2]
85 > )
86   {
87          int     tcnt = 0;
88          int     flags;
# Line 132 | Line 139 | RREAL  (*vc)[2];
139  
140  
141   static void
142 < add2bounds(vp, vc)              /* add point and uv coordinate to bounds */
143 < FVECT   vp;
144 < RREAL   vc[2];
142 > add2bounds(             /* add point and uv coordinate to bounds */
143 >        FVECT   vp,
144 >        RREAL   vc[2]
145 > )
146   {
147          register int    j;
148  
# Line 156 | Line 164 | RREAL  vc[2];
164  
165  
166   int                             /* create an extended triangle */
167 < cvtri(mo, vp1, vp2, vp3, vn1, vn2, vn3, vc1, vc2, vc3)
168 < OBJECT  mo;
169 < FVECT   vp1, vp2, vp3;
170 < FVECT   vn1, vn2, vn3;
171 < RREAL   vc1[2], vc2[2], vc3[2];
167 > cvtri(
168 >        OBJECT  mo,
169 >        FVECT   vp1,
170 >        FVECT   vp2,
171 >        FVECT   vp3,
172 >        FVECT   vn1,
173 >        FVECT   vn2,
174 >        FVECT   vn3,
175 >        RREAL   vc1[2],
176 >        RREAL   vc2[2],
177 >        RREAL   vc3[2]
178 > )
179   {
180          static OBJECT   fobj = OVOID;
181          char            buf[32];
# Line 203 | Line 218 | RREAL  vc1[2], vc2[2], vc3[2];
218                  fop = objptr(fobj);
219                  fop->omod = mo;
220                  fop->otype = OBJ_FACE;
221 <                sprintf(buf, "t%d", fobj);
221 >                sprintf(buf, "t%ld", fobj);
222                  fop->oname = savqstr(buf);
223                  fop->oargs.nfargs = 9;
224                  fop->oargs.farg = (RREAL *)malloc(9*sizeof(RREAL));
# Line 262 | Line 277 | nomem:
277  
278  
279   static OBJECT
280 < cvmeshtri(obj)                  /* add an extended triangle to our mesh */
281 < OBJECT  obj;
280 > cvmeshtri(                      /* add an extended triangle to our mesh */
281 >        OBJECT  obj
282 > )
283   {
284          OBJREC          *o = objptr(obj);
285          TRIDATA         *ts;
# Line 299 | Line 315 | OBJECT obj;
315  
316  
317   void
318 < cvmeshbounds()                  /* set mesh boundaries */
318 > cvmeshbounds(void)                      /* set mesh boundaries */
319   {
320          int     i;
321  
# Line 336 | Line 352 | cvmeshbounds()                 /* set mesh boundaries */
352  
353  
354   static OCTREE
355 < cvmeshoct(ot)                   /* convert triangles in subtree */
356 < OCTREE  ot;
355 > cvmeshoct(                      /* convert triangles in subtree */
356 >        OCTREE  ot
357 > )
358   {
359          int     i;
360  
# Line 361 | Line 378 | OCTREE ot;
378  
379  
380   MESH *
381 < cvmesh()                        /* convert mesh and octree leaf nodes */
381 > cvmesh(void)                    /* convert mesh and octree leaf nodes */
382   {
383          if (ourmesh == NULL)
384                  return(NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines