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.25 by greg, Tue Nov 6 01:56:37 2012 UTC vs.
Revision 2.26 by greg, Tue Nov 6 17:12:35 2012 UTC

# Line 148 | Line 148 | nextmeshtri(                           /* get next triangle ID */
148          MESH *mp
149   )
150   {
151        int             advance = 1;
151          int             pn;
152          MESHPATCH       *pp;
153  
154 <        if (*tip == OVOID) {                    /* check for first index */
156 <                *tip = 0;
157 <                advance = 0;
158 <        }
159 <        pn = *tip >> 10;
154 >        pn = ++(*tip) >> 10;                    /* next triangle (OVOID init) */
155          while (pn < mp->npatches) {
156                  pp = &mp->patch[pn];
157                  if (!(*tip & 0x200)) {          /* local triangle? */
158 <                        if ((*tip & 0x1ff) < pp->ntris - advance) {
164 <                                *tip += advance;
158 >                        if ((*tip & 0x1ff) < pp->ntris)
159                                  return(1);
166                        }
160                          *tip &= ~0x1ff;         /* move on to single-joiners */
161                          *tip |= 0x200;
169                        advance = 0;
162                  }
163                  if (!(*tip & 0x100)) {          /* single joiner? */
164 <                        if ((*tip & 0xff) < pp->nj1tris - advance) {
173 <                                *tip += advance;
164 >                        if ((*tip & 0xff) < pp->nj1tris)
165                                  return(1);
175                        }
166                          *tip &= ~0xff;          /* move on to double-joiners */
167                          *tip |= 0x100;
178                        advance = 0;
168                  }
169 <                if ((*tip & 0xff) < pp->nj2tris - advance) {
181 <                        *tip += advance;
169 >                if ((*tip & 0xff) < pp->nj2tris)
170                          return(1);
183                }
171                  *tip = ++pn << 10;              /* first in next patch */
185                advance = 0;
172          }
173          return(0);                              /* out of patches */
174   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines