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

Comparing ray/src/cv/mgflib/context.c (file contents):
Revision 1.12 by greg, Fri Jul 1 10:18:38 1994 UTC vs.
Revision 1.14 by greg, Thu Jul 7 17:27:58 1994 UTC

# Line 67 | Line 67 | register char  **av;
67                  lp = lu_find(&clr_tab, av[1]);  /* lookup context */
68                  if (lp == NULL)
69                          return(MG_EMEM);
70 +                c_ccname = lp->key;
71                  c_ccolor = (C_COLOR *)lp->data;
72                  if (ac == 2) {          /* reestablish previous context */
73                          if (c_ccolor == NULL)
# Line 83 | Line 84 | register char  **av;
84                          lp->data = (char *)malloc(sizeof(C_COLOR));
85                          if (lp->data == NULL)
86                                  return(MG_EMEM);
87 +                        c_ccname = lp->key;
88                          c_ccolor = (C_COLOR *)lp->data;
89                          c_ccolor->clock = 0;
90                  }
89                c_ccname = lp->key;
91                  i = c_ccolor->clock;
92                  if (ac == 3) {          /* use default template */
93                          *c_ccolor = c_dfcolor;
# Line 176 | Line 177 | register char  **av;
177                  lp = lu_find(&mat_tab, av[1]);  /* lookup context */
178                  if (lp == NULL)
179                          return(MG_EMEM);
180 +                c_cmname = lp->key;
181                  c_cmaterial = (C_MATERIAL *)lp->data;
182                  if (ac == 2) {          /* reestablish previous context */
183                          if (c_cmaterial == NULL)
# Line 192 | Line 194 | register char  **av;
194                          lp->data = (char *)malloc(sizeof(C_MATERIAL));
195                          if (lp->data == NULL)
196                                  return(MG_EMEM);
197 +                        c_cmname = lp->key;
198                          c_cmaterial = (C_MATERIAL *)lp->data;
199                          c_cmaterial->clock = 0;
200                  }
198                c_cmname = lp->key;
201                  i = c_cmaterial->clock;
202                  if (ac == 3) {          /* use default template */
203                          *c_cmaterial = c_dfmaterial;
# Line 269 | Line 271 | register char  **av;
271                  c_cmaterial->ts_c = *c_ccolor;
272                  c_cmaterial->clock++;
273                  return(MG_OK);
274 +        case MG_E_SIDES:        /* set number of sides */
275 +                if (ac != 2)
276 +                        return(MG_EARGC);
277 +                if (!isint(av[1]))
278 +                        return(MG_ETYPE);
279 +                i = atoi(av[1]);
280 +                if (i == 1)
281 +                        c_cmaterial->sided = 1;
282 +                else if (i == 2)
283 +                        c_cmaterial->sided = 0;
284 +                else
285 +                        return(MG_EILL);
286 +                c_cmaterial->clock++;
287 +                return(MG_OK);
288          }
289          return(MG_EUNK);
290   }
# Line 295 | Line 311 | register char  **av;
311                  lp = lu_find(&vtx_tab, av[1]);  /* lookup context */
312                  if (lp == NULL)
313                          return(MG_EMEM);
314 +                c_cvname = lp->key;
315                  c_cvertex = (C_VERTEX *)lp->data;
316                  if (ac == 2) {          /* reestablish previous context */
317                          if (c_cvertex == NULL)
# Line 311 | Line 328 | register char  **av;
328                          lp->data = (char *)malloc(sizeof(C_VERTEX));
329                          if (lp->data == NULL)
330                                  return(MG_EMEM);
331 +                        c_cvname = lp->key;
332                          c_cvertex = (C_VERTEX *)lp->data;
333                  }
316                c_cvname = lp->key;
334                  i = c_cvertex->clock;
335                  if (ac == 3) {          /* use default template */
336                          *c_cvertex = c_dfvertex;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines