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

Comparing ray/src/common/bsdf_m.c (file contents):
Revision 3.35 by greg, Thu Aug 27 04:33:31 2015 UTC vs.
Revision 3.37 by greg, Fri Jan 5 21:00:24 2018 UTC

# Line 191 | Line 191 | fo_getndx(const FVECT v, void *p)
191   double
192   io_getohm(int ndx, void *p)
193   {
194 +        static void     *last_p = NULL;
195          static int      last_li = -1;
196          static double   last_ohm;
197          ANGLE_BASIS     *ab = (ANGLE_BASIS *)p;
# Line 201 | Line 202 | io_getohm(int ndx, void *p)
202                  return -1.;
203          for (li = 0; ndx >= ab->lat[li].nphis; li++)
204                  ndx -= ab->lat[li].nphis;
205 <        if (li == last_li)                      /* cached latitude? */
205 >        if ((p == last_p) & (li == last_li))            /* cached latitude? */
206                  return last_ohm;
207 +        last_p = p;
208          last_li = li;
209          theta = M_PI/180. * ab->lat[li].tmin;
210          theta1 = M_PI/180. * ab->lat[li+1].tmin;
# Line 906 | Line 908 | SDsampMtxCDist(FVECT ioVec, double randX, const SDCDst
908   }
909  
910   /* Fixed resolution BSDF methods */
911 < SDFunc                  SDhandleMtx = {
911 > const SDFunc            SDhandleMtx = {
912                                  &SDgetMtxBSDF,
913                                  &SDqueryMtxProjSA,
914                                  &SDgetMtxCDist,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines