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

Comparing ray/src/common/modobject.c (file contents):
Revision 2.15 by greg, Sun Dec 8 19:25:36 2013 UTC vs.
Revision 2.16 by greg, Mon Dec 9 17:57:44 2013 UTC

# Line 135 | Line 135 | eqobjects(                     /* check if two objects are equal */
135                  for (i = op1->oargs.nsargs; i-- > 0; )
136                          if (strcmp(op1->oargs.sarg[i], op2->oargs.sarg[i]))
137                                  return(0);
138 +                i = 0;
139 +                switch (op1->otype) {   /* special cases (KEEP CONSISTENT!) */
140 +                case MOD_ALIAS:
141 +                case MAT_ILLUM:
142 +                case MAT_MIRROR:
143 +                        i = (op1->oargs.nsargs > 0);
144 +                        break;
145 +                case MIX_FUNC:
146 +                case MIX_DATA:
147 +                case MIX_TEXT:
148 +                case MIX_PICT:
149 +                        i = 2*(op1->oargs.nsargs >= 2);
150 +                        break;
151 +                case MAT_CLIP:
152 +                        i = op1->oargs.nsargs;
153 +                        break;
154 +                }
155 +                while (i-- > 0)         /* check modifier references */
156 +                        if (!eqobjects( lastmod(obj1, op1->oargs.sarg[i]),
157 +                                        lastmod(obj2, op2->oargs.sarg[i]) ))
158 +                                return(0);
159                  obj1 = op1->omod;
160                  obj2 = op2->omod;
161          }
# Line 152 | Line 173 | insertobject(                  /* insert new object into our list */
173          if (ismodifier(objptr(obj)->otype)) {
174                  i = otndx(objptr(obj)->oname, &modtab);
175                  if (eqobjects(obj, modtab.htab[i]))
176 <                        return;
176 >                        return; /* don't index if same as earlier def. */
177                  modtab.htab[i] = obj;
178          }
179   #ifdef  GETOBJ

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines