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

Comparing ray/src/rt/initotypes.c (file contents):
Revision 2.22 by greg, Tue Jun 26 14:42:18 2018 UTC vs.
Revision 2.25 by greg, Sat Nov 10 16:12:26 2018 UTC

# Line 74 | Line 74 | initotypes(void)                       /* initialize ofun array */
74          ofun[MAT_TDATA].funp = m_brdf2;
75          ofun[MAT_PFUNC].flags |= T_OPAQUE;
76          ofun[MAT_MFUNC].flags |= T_OPAQUE;
77 +        ofun[MAT_TFUNC].flags |= T_OPAQUE;
78          ofun[MAT_PDATA].flags |= T_OPAQUE;
79          ofun[MAT_MDATA].flags |= T_OPAQUE;
80 +        ofun[MAT_TDATA].flags |= T_OPAQUE;
81          ofun[TEX_FUNC].funp = t_func;
82          ofun[TEX_DATA].funp = t_data;
83          ofun[PAT_CFUNC].funp = p_cfunc;
# Line 99 | Line 101 | o_default(OBJREC *o, RAY *r)                   /* default action is er
101                                  /* unused call to load freeobjmem.o */
102          free_objs(0, 0);
103          return(0);
104 + }
105 +
106 +
107 +
108 + OBJREC *                        /* find an object's actual material */
109 + findmaterial(OBJREC *o)
110 + {
111 +        while (!ismaterial(o->otype)) {
112 +                if (o->otype == MOD_ALIAS && o->oargs.nsargs) {
113 +                        OBJECT  aobj;
114 +                        OBJREC  *ao;
115 +                        aobj = lastmod(objndx(o), o->oargs.sarg[0]);
116 +                        if (aobj < 0)
117 +                                objerror(o, USER, "bad reference");
118 +                                /* recursive check on alias branch */
119 +                        if ((ao = findmaterial(objptr(aobj))) != NULL)
120 +                                return(ao);
121 +                }
122 +                if (o->omod == OVOID) {
123 +                                /* assume unmodified mixture is material */
124 +                        if (ismixture(o->otype))
125 +                                break;
126 +                        return(NULL);
127 +                }
128 +                o = objptr(o->omod);
129 +        }
130 +        return(o);
131   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines