| 1 |
< |
/* Copyright (c) 1988 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1990 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 28 |
|
char *pathname; |
| 29 |
|
register SCENE *sc; |
| 30 |
|
|
| 31 |
< |
flags &= ~IO_FILES; /* not allowed */ |
| 31 |
> |
flags &= ~(IO_FILES|IO_INFO); /* not allowed */ |
| 32 |
|
for (sc = slist; sc != NULL; sc = sc->next) |
| 33 |
|
if (!strcmp(sname, sc->name)) { |
| 34 |
|
if ((sc->ldflags & flags) == flags) |
| 66 |
|
error(SYSTEM, "out of memory in getinstance"); |
| 67 |
|
if (o->oargs.nsargs < 1) |
| 68 |
|
objerror(o, USER, "bad # of arguments"); |
| 69 |
< |
in->f.sca = 1.0; |
| 70 |
< |
setident4(in->f.xfm); |
| 71 |
< |
if (xf(in->f.xfm, &in->f.sca, o->oargs.nsargs-1, |
| 69 |
> |
if (fullxf(&in->x, o->oargs.nsargs-1, |
| 70 |
|
o->oargs.sarg+1) != o->oargs.nsargs-1) |
| 71 |
|
objerror(o, USER, "bad transform"); |
| 72 |
< |
if (in->f.sca < 0.0) |
| 73 |
< |
in->f.sca = -in->f.sca; |
| 74 |
< |
in->b.sca = 1.0; |
| 75 |
< |
setident4(in->b.xfm); |
| 78 |
< |
invxf(in->b.xfm, &in->b.sca,o->oargs.nsargs-1,o->oargs.sarg+1); |
| 79 |
< |
if (in->b.sca < 0.0) |
| 80 |
< |
in->b.sca = -in->b.sca; |
| 72 |
> |
if (in->x.f.sca < 0.0) |
| 73 |
> |
in->x.f.sca = -in->x.f.sca; |
| 74 |
> |
if (in->x.b.sca < 0.0) |
| 75 |
> |
in->x.b.sca = -in->x.b.sca; |
| 76 |
|
in->obj = NULL; |
| 77 |
|
o->os = (char *)in; |
| 78 |
|
} |
| 79 |
|
if (in->obj == NULL || (in->obj->ldflags & flags) != flags) |
| 80 |
|
in->obj = getscene(o->oargs.sarg[0], flags); |
| 81 |
|
return(in); |
| 82 |
+ |
} |
| 83 |
+ |
|
| 84 |
+ |
|
| 85 |
+ |
freeinstance(o) /* free memory associated with instance */ |
| 86 |
+ |
OBJREC *o; |
| 87 |
+ |
{ |
| 88 |
+ |
if (o->os == NULL) |
| 89 |
+ |
return; |
| 90 |
+ |
free(o->os); |
| 91 |
+ |
o->os = NULL; |
| 92 |
|
} |