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

Comparing ray/src/common/mgf_context.c (file contents):
Revision 3.2 by greg, Thu May 17 17:10:23 2012 UTC vs.
Revision 3.3 by greg, Wed Sep 20 21:56:13 2023 UTC

# Line 59 | Line 59 | c_hcolor(int ac, char **av)            /* handle color entity */
59                          return(MG_EMEM);
60                  c_ccname = lp->key;
61                  c_ccolor = (C_COLOR *)lp->data;
62 <                if (ac == 2) {          /* reestablish previous context */
63 <                        if (c_ccolor == NULL)
62 >                if (ac == 2 || (ac == 4 && !strcmp(av[1], av[3]))) {
63 >                        if (c_ccolor == NULL)   /* reestablish context */
64                                  return(MG_EUNDEF);
65                          return(MG_OK);
66                  }
# Line 172 | Line 172 | c_hmaterial(int ac, char **av)         /* handle material ent
172                          return(MG_EMEM);
173                  c_cmname = lp->key;
174                  c_cmaterial = (C_MATERIAL *)lp->data;
175 <                if (ac == 2) {          /* reestablish previous context */
176 <                        if (c_cmaterial == NULL)
175 >                if (ac == 2 || (ac == 4 && !strcmp(av[1], av[3]))) {
176 >                        if (c_cmaterial == NULL) /* reestablish context */
177                                  return(MG_EUNDEF);
178                          return(MG_OK);
179                  }
# Line 318 | Line 318 | c_hvertex(int ac, char **av)           /* handle a vertex entit
318                          return(MG_EMEM);
319                  c_cvname = lp->key;
320                  c_cvertex = (C_VERTEX *)lp->data;
321 <                if (ac == 2) {          /* reestablish previous context */
322 <                        if (c_cvertex == NULL)
321 >                if (ac == 2 || (ac == 4 && !strcmp(av[1], av[3]))) {
322 >                        if (c_cvertex == NULL)  /* reestablish context */
323                                  return(MG_EUNDEF);
324                          return(MG_OK);
325                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines