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.15 by schorsch, Fri Nov 14 17:22:06 2003 UTC vs.
Revision 2.18 by greg, Tue Mar 16 19:56:27 2004 UTC

# Line 10 | Line 10 | static const char RCSid[] = "$Id$";
10   #include "rtio.h"
11   #include "rtmath.h"
12   #include "rterror.h"
13 <
13 > #include "paths.h"
14   #include "octree.h"
15   #include "object.h"
16   #include "otypes.h"
# Line 21 | Line 21 | typedef struct {
21          int             fl;
22          uint32          xyz[3];
23          int32           norm;
24 <        uint16          uv[2];
24 >        uint32          uv[2];
25   } MCVERT;
26  
27   #define  MPATCHBLKSIZ   128             /* patch allocation block size */
# Line 238 | Line 238 | int            what;
238                  for (i = 0; i < 2; i++)
239                          vp->uv[i] = mp->uvlim[0][i] +
240                                  (mp->uvlim[1][i] - mp->uvlim[0][i])*
241 <                                (pp->uv[vid][i] + .5)*(1./65536.);
241 >                                (pp->uv[vid][i] + .5)*(1./4294967296.);
242                  vp->fl |= MT_UV;
243          }
244          return(vp->fl);
# Line 309 | Line 309 | MESHVERT       *vp;
309                                  (vp->v[i] - mp->mcube.cuorg[i]) /
310                                  mp->mcube.cusize);
311          }
312 <        if (vp->fl & MT_N)
312 >        if (vp->fl & MT_N)              /* assumes normalized! */
313                  cv.norm = encodedir(vp->n);
314          if (vp->fl & MT_UV)
315                  for (i = 0; i < 2; i++) {
# Line 317 | Line 317 | MESHVERT       *vp;
317                                  return(-1);
318                          if (vp->uv[i] >= mp->uvlim[1][i])
319                                  return(-1);
320 <                        cv.uv[i] = (uint32)(65536. *
320 >                        cv.uv[i] = (uint32)(4294967296. *
321                                          (vp->uv[i] - mp->uvlim[0][i]) /
322                                          (mp->uvlim[1][i] - mp->uvlim[0][i]));
323                  }
# Line 375 | Line 375 | MESHVERT       *vp;
375                  }
376                  if (cv.fl & MT_UV) {
377                          if (pp->uv == NULL) {
378 <                                pp->uv = (uint16 (*)[2])calloc(256,
379 <                                                2*sizeof(uint16));
378 >                                pp->uv = (uint32 (*)[2])calloc(256,
379 >                                                2*sizeof(uint32));
380                                  if (pp->uv == NULL)
381                                          goto nomem;
382                          }
# Line 546 | Line 546 | register MESH  *mp;
546                                  if (nouvbounds && pp->uv != NULL)
547                                          return("unreferenced uv coordinates");
548                          }
549                        if (pp->ntris + pp->nj1tris + pp->nj2tris <= 0)
550                                error(WARNING, "no triangles in patch");
549                          if (pp->ntris > 0 && pp->tri == NULL)
550                                  return("missing patch triangle list");
551                          if (pp->nj1tris > 0 && pp->j1tri == NULL)
# Line 620 | Line 618 | FILE   *fp;
618                          (ms->npatches*sizeof(MESHPATCH) +
619                          vcnt*3*sizeof(uint32) +
620                          nscnt*sizeof(int32) +
621 <                        uvscnt*2*sizeof(uint16) +
621 >                        uvscnt*2*sizeof(uint32) +
622                          tcnt*sizeof(struct PTri) +
623                          t1cnt*sizeof(struct PJoin1) +
624                          t2cnt*sizeof(struct PJoin2))/(1024.*1024.));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines