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.16 by greg, Fri Jan 30 00:08:31 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 "octree.h"
14   #include "object.h"
15   #include "otypes.h"
# Line 21 | Line 20 | typedef struct {
20          int             fl;
21          uint32          xyz[3];
22          int32           norm;
23 <        uint16          uv[2];
23 >        uint32          uv[2];
24   } MCVERT;
25  
26   #define  MPATCHBLKSIZ   128             /* patch allocation block size */
# Line 238 | Line 237 | int            what;
237                  for (i = 0; i < 2; i++)
238                          vp->uv[i] = mp->uvlim[0][i] +
239                                  (mp->uvlim[1][i] - mp->uvlim[0][i])*
240 <                                (pp->uv[vid][i] + .5)*(1./65536.);
240 >                                (pp->uv[vid][i] + .5)*(1./4294967296.);
241                  vp->fl |= MT_UV;
242          }
243          return(vp->fl);
# Line 309 | Line 308 | MESHVERT       *vp;
308                                  (vp->v[i] - mp->mcube.cuorg[i]) /
309                                  mp->mcube.cusize);
310          }
311 <        if (vp->fl & MT_N)
311 >        if (vp->fl & MT_N)              /* assumes normalized! */
312                  cv.norm = encodedir(vp->n);
313          if (vp->fl & MT_UV)
314                  for (i = 0; i < 2; i++) {
# Line 317 | Line 316 | MESHVERT       *vp;
316                                  return(-1);
317                          if (vp->uv[i] >= mp->uvlim[1][i])
318                                  return(-1);
319 <                        cv.uv[i] = (uint32)(65536. *
319 >                        cv.uv[i] = (uint32)(4294967296. *
320                                          (vp->uv[i] - mp->uvlim[0][i]) /
321                                          (mp->uvlim[1][i] - mp->uvlim[0][i]));
322                  }
# Line 375 | Line 374 | MESHVERT       *vp;
374                  }
375                  if (cv.fl & MT_UV) {
376                          if (pp->uv == NULL) {
377 <                                pp->uv = (uint16 (*)[2])calloc(256,
378 <                                                2*sizeof(uint16));
377 >                                pp->uv = (uint32 (*)[2])calloc(256,
378 >                                                2*sizeof(uint32));
379                                  if (pp->uv == NULL)
380                                          goto nomem;
381                          }
# Line 620 | Line 619 | FILE   *fp;
619                          (ms->npatches*sizeof(MESHPATCH) +
620                          vcnt*3*sizeof(uint32) +
621                          nscnt*sizeof(int32) +
622 <                        uvscnt*2*sizeof(uint16) +
622 >                        uvscnt*2*sizeof(uint32) +
623                          tcnt*sizeof(struct PTri) +
624                          t1cnt*sizeof(struct PJoin1) +
625                          t2cnt*sizeof(struct PJoin2))/(1024.*1024.));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines