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

Comparing ray/src/rt/m_alias.c (file contents):
Revision 2.3 by greg, Tue Sep 9 03:28:43 2003 UTC vs.
Revision 2.4 by greg, Tue Jan 20 22:16:53 2004 UTC

# Line 27 | Line 27 | OBJREC *m;
27   RAY     *r;
28   {
29          OBJECT  aobj;
30 +        OBJREC  *aop;
31          OBJREC  arec;
32 +        int     rval;
33                                          /* straight replacement? */
34          if (!m->oargs.nsargs)
35                  return(rayshade(r, m->omod));
# Line 37 | Line 39 | RAY    *r;
39          aobj = lastmod(objndx(m), m->oargs.sarg[0]);
40          if (aobj < 0)
41                  objerror(m, USER, "bad reference");
42 <        arec = *objptr(aobj);
42 >        aop = objptr(aobj);
43 >        arec = *aop;
44                                          /* irradiance hack */
45          if (do_irrad && !(r->crtype & ~(PRIMARY|TRANS)) &&
46                          m->otype != MAT_CLIP &&
# Line 52 | Line 55 | RAY    *r;
55                                          /* substitute modifier */
56          arec.omod = m->omod;
57                                          /* replacement shader */
58 <        return((*ofun[arec.otype].funp)(&arec, r));
58 >        rval = (*ofun[arec.otype].funp)(&arec, r);
59 >                                        /* save allocated struct */
60 >        if (arec.os != aop->os) {
61 >                if (aop->os != NULL)    /* should never happen */
62 >                        free_os(aop);
63 >                aop->os = arec.os;
64 >        }
65 >        return(rval);
66   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines