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

Comparing ray/src/common/mesh.c (file contents):
Revision 2.27 by greg, Tue Mar 22 03:56:17 2016 UTC vs.
Revision 2.28 by greg, Wed Mar 1 21:51:38 2017 UTC

# Line 52 | Line 52 | static int
52   cvcmp(const char *vv1, const char *vv2)         /* compare encoded vertices */
53   {
54          const MCVERT    *v1 = (const MCVERT *)vv1, *v2 = (const MCVERT *)vv2;
55 +
56          if (v1->fl != v2->fl)
57                  return(1);
58          if (v1->xyz[0] != v2->xyz[0])
# Line 327 | Line 328 | getmeshtri(                    /* get triangle vertices */
328  
329   int32
330   addmeshvert(                    /* find/add a mesh vertex */
331 <        MESH    *mp,
331 >        MESH            *mp,
332          MESHVERT        *vp
333   )
334   {
335 <        LUENT           *lvp;
336 <        MCVERT          cv;
335 >        LUENT   *lvp;
336 >        MCVERT  cv;
337          int     i;
338  
339          if (!(vp->fl & MT_V))
# Line 439 | Line 440 | addmeshtri(                    /* add a new mesh triangle */
440          OBJECT          mo
441   )
442   {
443 <        int32                   vid[3], t;
444 <        int                     pn[3], i;
443 >        int32           vid[3], t;
444 >        int             pn[3], i;
445          MESHPATCH       *pp;
446  
447          if (!(tv[0].fl & tv[1].fl & tv[2].fl & MT_V))
# Line 459 | Line 460 | addmeshtri(                    /* add a new mesh triangle */
460                          error(INTERNAL, "modifier range error in addmeshtri");
461          }
462                                  /* assign triangle */
463 <        if (pn[0] == pn[1] && pn[1] == pn[2]) { /* local case */
463 >        if ((pn[0] == pn[1]) & (pn[1] == pn[2])) {      /* local case */
464                  pp = &mp->patch[pn[0]];
465                  if (pp->tri == NULL) {
466                          pp->tri = (struct PTri *)malloc(
# Line 485 | Line 486 | addmeshtri(                    /* add a new mesh triangle */
486                                  pp->trimat[pp->ntris] = mo;
487                          return(pn[0] << 10 | pp->ntris++);
488                  }
489 <        }
489 <        if (pn[0] == pn[1]) {
489 >        } else if (pn[0] == pn[1]) {
490                  t = vid[2]; vid[2] = vid[1]; vid[1] = vid[0]; vid[0] = t;
491                  i = pn[2]; pn[2] = pn[1]; pn[1] = pn[0]; pn[0] = i;
492          } else if (pn[0] == pn[2]) {
# Line 535 | Line 535 | checkmesh(MESH *mp)                    /* validate mesh data */
535   {
536          static char     embuf[128];
537          int             nouvbounds = 1;
538 <        int     i;
538 >        int             i;
539                                          /* basic checks */
540          if (mp == NULL)
541                  return("NULL mesh pointer");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines