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.36 by greg, Fri Oct 14 00:54:21 2016 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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines