| 29 |
|
C_MATERIAL *c_cmaterial = &c_unmaterial; |
| 30 |
|
C_VERTEX *c_cvertex = &c_unvertex; |
| 31 |
|
|
| 32 |
< |
static LUTAB clr_tab; /* color lookup table */ |
| 33 |
< |
static LUTAB mat_tab; /* material lookup table */ |
| 34 |
< |
static LUTAB vtx_tab; /* vertex lookup table */ |
| 32 |
> |
static LUTAB clr_tab = LU_SINIT(free,free); /* color lookup table */ |
| 33 |
> |
static LUTAB mat_tab = LU_SINIT(free,free); /* material lookup table */ |
| 34 |
> |
static LUTAB vtx_tab = LU_SINIT(free,free); /* vertex lookup table */ |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
int |
| 43 |
|
|
| 44 |
|
switch (mg_entity(av[0])) { |
| 45 |
|
case MG_E_COLOR: /* get/set color context */ |
| 46 |
+ |
if (ac > 4) |
| 47 |
+ |
return(MG_EARGC); |
| 48 |
|
if (ac == 1) { /* set unnamed color context */ |
| 49 |
|
c_uncolor = c_dfcolor; |
| 50 |
|
c_ccolor = &c_uncolor; |
| 109 |
|
|
| 110 |
|
switch (mg_entity(av[0])) { |
| 111 |
|
case MG_E_MATERIAL: /* get/set material context */ |
| 112 |
+ |
if (ac > 4) |
| 113 |
+ |
return(MG_EARGC); |
| 114 |
|
if (ac == 1) { /* set unnamed material context */ |
| 115 |
|
c_unmaterial = c_dfmaterial; |
| 116 |
|
c_cmaterial = &c_unmaterial; |
| 225 |
|
|
| 226 |
|
switch (mg_entity(av[0])) { |
| 227 |
|
case MG_E_VERTEX: /* get/set vertex context */ |
| 228 |
+ |
if (ac > 4) |
| 229 |
+ |
return(MG_EARGC); |
| 230 |
|
if (ac == 1) { /* set unnamed vertex context */ |
| 231 |
|
c_unvertex = c_dfvertex; |
| 232 |
|
c_cvertex = &c_unvertex; |
| 290 |
|
} |
| 291 |
|
|
| 292 |
|
|
| 287 |
– |
static void |
| 288 |
– |
freectx(lp) /* free a context table entry */ |
| 289 |
– |
register LUENT *lp; |
| 290 |
– |
{ |
| 291 |
– |
free((MEM_PTR)lp->key); |
| 292 |
– |
free((MEM_PTR)lp->data); |
| 293 |
– |
} |
| 294 |
– |
|
| 295 |
– |
|
| 293 |
|
void |
| 294 |
|
c_clearall() /* empty context tables */ |
| 295 |
|
{ |
| 296 |
|
c_uncolor = c_dfcolor; |
| 297 |
|
c_ccolor = &c_uncolor; |
| 298 |
< |
lu_done(&clr_tab, freectx); |
| 298 |
> |
lu_done(&clr_tab); |
| 299 |
|
c_unmaterial = c_dfmaterial; |
| 300 |
|
c_cmaterial = &c_unmaterial; |
| 301 |
< |
lu_done(&mat_tab, freectx); |
| 301 |
> |
lu_done(&mat_tab); |
| 302 |
|
c_unvertex = c_dfvertex; |
| 303 |
|
c_cvertex = &c_unvertex; |
| 304 |
< |
lu_done(&vtx_tab, freectx); |
| 304 |
> |
lu_done(&vtx_tab); |
| 305 |
|
} |
| 306 |
|
|
| 307 |
|
|