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

Comparing ray/src/common/bsdf_t.c (file contents):
Revision 3.13 by greg, Wed Jun 1 00:29:40 2011 UTC vs.
Revision 3.14 by greg, Wed Jun 1 05:21:18 2011 UTC

# Line 91 | Line 91 | SDfreeTre(SDNode *st)
91                  return;
92          for (n = (st->log2GR < 0) << st->ndim; n--; )
93                  SDfreeTre(st->u.t[n]);
94 <        free((void *)st);
94 >        free(st);
95   }
96  
97   /* Free a variable-resolution BSDF */
# Line 125 | Line 125 | fill_grid_branch(float *dptr, const float *sptr, int n
125   static float *
126   grid_branch_start(SDNode *st, int n)
127   {
128 <        unsigned        skipsiz = 1 << st->log2GR;
128 >        unsigned        skipsiz = 1 << (st->log2GR - 1);
129          float           *vptr = st->u.v;
130          int             i;
131  
132 <        for (i = 0; i < st->ndim; skipsiz <<= st->log2GR)
133 <                if (1<<i++ & n)
134 <                        vptr += skipsiz >> 1;
132 >        for (i = st->ndim; i--; skipsiz <<= st->log2GR)
133 >                if (1<<i & n)
134 >                        vptr += skipsiz;
135          return vptr;
136   }
137  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines