1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
4 |
> |
static char SCCSid[] = "$SunId$ SGI"; |
5 |
|
#endif |
6 |
|
|
7 |
|
/* |
26 |
|
register RAY *r; |
27 |
|
{ |
28 |
|
OBJECT cset[MAXSET+1], *modset; |
29 |
+ |
OBJECT obj, mod; |
30 |
|
int entering; |
31 |
|
register int i; |
32 |
|
|
33 |
+ |
obj = objndx(m); |
34 |
|
if ((modset = (OBJECT *)m->os) == NULL) { |
33 |
– |
register OBJECT mod; |
34 |
– |
|
35 |
|
if (m->oargs.nsargs < 1 || m->oargs.nsargs > MAXSET) |
36 |
|
objerror(m, USER, "bad # arguments"); |
37 |
|
modset = (OBJECT *)malloc((m->oargs.nsargs+1)*sizeof(OBJECT)); |
41 |
|
for (i = 0; i < m->oargs.nsargs; i++) { |
42 |
|
if (!strcmp(m->oargs.sarg[i], VOIDID)) |
43 |
|
continue; |
44 |
< |
if ((mod = modifier(m->oargs.sarg[i])) == OVOID) { |
44 |
> |
if ((mod = lastmod(obj, m->oargs.sarg[i])) == OVOID) { |
45 |
|
sprintf(errmsg, "unknown modifier \"%s\"", |
46 |
|
m->oargs.sarg[i]); |
47 |
|
objerror(m, WARNING, errmsg); |
53 |
|
} |
54 |
|
insertelem(modset, mod); |
55 |
|
} |
56 |
< |
(OBJECT *)m->os = modset; |
56 |
> |
m->os = (char *)modset; |
57 |
|
} |
58 |
|
if (r->clipset != NULL) |
59 |
|
setcopy(cset, r->clipset); |
89 |
|
inside--; |
90 |
|
if (inside > 0) { /* we just hit the object */ |
91 |
|
flipsurface(r); |
92 |
< |
rayshade(r, modifier(m->oargs.sarg[0])); |
93 |
< |
return; |
92 |
> |
return(rayshade(r, lastmod(obj, m->oargs.sarg[0]))); |
93 |
|
} |
94 |
|
} |
95 |
|
raytrans(r); /* else transfer ray */ |
96 |
+ |
return(1); |
97 |
|
} |