31 |
|
static int raymove(), checkhit(); |
32 |
|
static void checkset(); |
33 |
|
|
34 |
– |
#ifndef MAXLOOP |
35 |
– |
#define MAXLOOP 0 /* modifier loop detection */ |
36 |
– |
#endif |
37 |
– |
|
34 |
|
#define RAYHIT (-1) /* return value for intercepted ray */ |
35 |
|
|
36 |
|
|
154 |
|
{ |
155 |
|
int gotmat; |
156 |
|
register OBJREC *m; |
161 |
– |
#if MAXLOOP |
162 |
– |
static int depth = 0; |
163 |
– |
/* check for infinite loop */ |
164 |
– |
if (depth++ >= MAXLOOP) |
165 |
– |
objerror(r->ro, USER, "possible modifier loop"); |
166 |
– |
#endif |
157 |
|
r->rt = r->rot; /* set effective ray length */ |
158 |
|
for (gotmat = 0; !gotmat && mod != OVOID; mod = m->omod) { |
159 |
|
m = objptr(mod); |
168 |
|
m->otype != MAT_CLIP && |
169 |
|
(ofun[m->otype].flags & (T_M|T_X))) { |
170 |
|
if (irr_ignore(m->otype)) { |
181 |
– |
#if MAXLOOP |
182 |
– |
depth--; |
183 |
– |
#endif |
171 |
|
raytrans(r); |
172 |
|
return(1); |
173 |
|
} |
177 |
|
/* materials call raytexture */ |
178 |
|
gotmat = (*ofun[m->otype].funp)(m, r); |
179 |
|
} |
193 |
– |
#if MAXLOOP |
194 |
– |
depth--; |
195 |
– |
#endif |
180 |
|
return(gotmat); |
181 |
|
} |
182 |
|
|
219 |
|
OBJECT mod; |
220 |
|
{ |
221 |
|
register OBJREC *m; |
238 |
– |
#if MAXLOOP |
239 |
– |
static int depth = 0; |
240 |
– |
/* check for infinite loop */ |
241 |
– |
if (depth++ >= MAXLOOP) |
242 |
– |
objerror(r->ro, USER, "modifier loop"); |
243 |
– |
#endif |
222 |
|
/* execute textures and patterns */ |
223 |
|
for ( ; mod != OVOID; mod = m->omod) { |
224 |
|
m = objptr(mod); |
234 |
|
objerror(r->ro, USER, errmsg); |
235 |
|
} |
236 |
|
} |
259 |
– |
#if MAXLOOP |
260 |
– |
depth--; /* end here */ |
261 |
– |
#endif |
237 |
|
} |
238 |
|
|
239 |
|
|