58 |
|
|
59 |
|
static int |
60 |
|
inslist( /* return index of source n if it's in list sl */ |
61 |
< |
register int *sl, |
62 |
< |
register int n |
61 |
> |
int *sl, |
62 |
> |
int n |
63 |
|
) |
64 |
|
{ |
65 |
< |
register int i; |
65 |
> |
int i; |
66 |
|
|
67 |
|
for (i = sl[0]; i > 0; i--) |
68 |
|
if (sl[i] == n) |
73 |
|
|
74 |
|
static int |
75 |
|
srcmatch( /* check for an id match on a light source */ |
76 |
< |
register SRCREC *sp, |
77 |
< |
register char *id |
76 |
> |
SRCREC *sp, |
77 |
> |
char *id |
78 |
|
) |
79 |
|
{ |
80 |
< |
register char *cp; |
80 |
> |
char *cp; |
81 |
|
/* check for relay sources */ |
82 |
|
while ((cp = strchr(id, RELAYDELIM)) != NULL) { |
83 |
|
if (!(sp->sflags & SVIRTUAL) || sp->so == NULL) |
95 |
|
|
96 |
|
static void |
97 |
|
add2slist( /* add source list to ray's */ |
98 |
< |
register RAY *r, |
99 |
< |
register int *sl |
98 |
> |
RAY *r, |
99 |
> |
int *sl |
100 |
|
) |
101 |
|
{ |
102 |
|
static int slspare[MAXSLIST+1]; /* in case of emergence */ |
103 |
< |
register int i; |
103 |
> |
int i; |
104 |
|
|
105 |
|
if (sl == NULL || sl[0] == 0) /* nothing to add */ |
106 |
|
return; |
116 |
|
} |
117 |
|
|
118 |
|
|
119 |
< |
extern int |
119 |
> |
int |
120 |
|
m_mist( /* process a ray entering or leaving some mist */ |
121 |
|
OBJREC *m, |
122 |
< |
register RAY *r |
122 |
> |
RAY *r |
123 |
|
) |
124 |
|
{ |
125 |
|
RAY p; |
127 |
|
int newslist[MAXSLIST+1]; |
128 |
|
COLOR mext; |
129 |
|
double re, ge, be; |
130 |
< |
register int i, j; |
130 |
> |
int i, j; |
131 |
|
/* check arguments */ |
132 |
|
if (m->oargs.nfargs > 7) |
133 |
|
objerror(m, USER, "bad arguments"); |
165 |
|
} else |
166 |
|
setcolor(mext, 0., 0., 0.); |
167 |
|
/* start transmitted ray */ |
168 |
< |
if (rayorigin(&p, r, TRANS, 1.) < 0) |
168 |
> |
if (rayorigin(&p, TRANS, r, NULL) < 0) |
169 |
|
return(1); |
170 |
|
VCOPY(p.rdir, r->rdir); |
171 |
|
p.slights = newslist; |
218 |
|
} |
219 |
|
rayvalue(&p); /* calls rayparticipate() */ |
220 |
|
copycolor(r->rcol, p.rcol); /* return value */ |
221 |
< |
r->rt = r->rot + p.rt; |
221 |
> |
copycolor(r->mcol, p.mcol); |
222 |
> |
r->rmt = r->rot + p.rmt; |
223 |
> |
r->rxt = r->rot + p.rxt; |
224 |
|
return(1); |
225 |
|
memerr: |
226 |
|
error(SYSTEM, "out of memory in m_mist"); |