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.28 by greg, Sun Jan 31 17:49:21 2021 UTC vs.
Revision 2.31 by greg, Wed Nov 15 18:02:52 2023 UTC

# Line 84 | Line 84 | initotypes(void)                       /* initialize ofun array */
84          ofun[PAT_BFUNC].funp = p_bfunc;
85          ofun[PAT_CPICT].funp = p_pdata;
86          ofun[PAT_CDATA].funp = p_cdata;
87 +        ofun[PAT_SPECTRUM].funp = p_spectrum;
88 +        ofun[PAT_SPECFILE].funp = p_specfile;
89 +        ofun[PAT_SPECFUNC].funp = p_specfunc;
90          ofun[PAT_BDATA].funp = p_bdata;
91          ofun[PAT_CTEXT].funp =
92          ofun[PAT_BTEXT].funp =
# Line 107 | Line 110 | o_default(OBJREC *o, RAY *r)           /* default action is err
110   OBJREC *        
111   findmaterial(OBJREC *o)                 /* find an object's actual material */
112   {
113 <        OBJECT  mod = OVOID;
113 >        OBJECT  obj = OVOID;
114  
115          while (!ismaterial(o->otype)) {
116                  if (o->otype == MOD_ALIAS && o->oargs.nsargs) {
117 <                        OBJREC  *ao;    /* check if aliased to material */
118 <                        if (mod == OVOID)
119 <                                mod = objndx(o);
120 <                        mod = lastmod(mod, o->oargs.sarg[0]);
121 <                        if (mod < 0)
122 <                                objerror(o, USER, "bad reference");
123 <                        while ((ao = objptr(mod))->otype == MOD_ALIAS &&
124 <                                        !ao->oargs.nsargs)
125 <                                mod = ao->omod;
117 >                        OBJREC  *ao = o;
118 >                        if (obj == OVOID)
119 >                                obj = objndx(o);
120 >                        do {
121 >                                if (!ao->oargs.nsargs)
122 >                                        obj = ao->omod;
123 >                                else
124 >                                        obj = lastmod(obj, ao->oargs.sarg[0]);
125 >                                if (obj == OVOID)
126 >                                        objerror(ao, USER, "bad reference");
127 >                                ao = objptr(obj);
128 >                        } while (ao->otype == MOD_ALIAS);
129 >                                        /* check if aliased to material */
130                          if (ismaterial(ao->otype))
131                                  return(ao);
132                  }
# Line 129 | Line 136 | findmaterial(OBJREC *o)                        /* find an object's actual m
136                                  break;
137                          return(NULL);   /* else no material found */
138                  }
139 <                o = objptr(mod = o->omod);
139 >                obj = o->omod;
140 >                o = objptr(obj);
141          }
142          return(o);
143   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines