64 |
|
static void reset_flags(void); |
65 |
|
static void init_wfunc(void); |
66 |
|
static int findneigh(short nl[NNEIGH][2], int nd[NNEIGH], int h, int v, |
67 |
< |
register short (*rnl)[NNEIGH]); |
67 |
> |
short (*rnl)[NNEIGH]); |
68 |
|
|
69 |
|
|
70 |
< |
extern void |
70 |
> |
void |
71 |
|
pixBeam( /* render a particular beam */ |
72 |
|
BEAM *bp, |
73 |
< |
register HDBEAMI *hb |
73 |
> |
HDBEAMI *hb |
74 |
|
) |
75 |
|
{ |
76 |
|
GCOORD gc[2]; |
77 |
< |
register RAYVAL *rv; |
77 |
> |
RAYVAL *rv; |
78 |
|
FVECT rorg, rdir, wp, ip; |
79 |
|
double d, prox; |
80 |
|
COLOR col; |
81 |
|
int n; |
82 |
< |
register int32 p; |
82 |
> |
int32 p; |
83 |
|
|
84 |
|
if (!hdbcoord(gc, hb->h, hb->b)) |
85 |
|
error(CONSISTENCY, "bad beam in render_beam"); |
99 |
|
VSUM(wp, myview.vp, rdir, FHUGE); |
100 |
|
prox = 1.; |
101 |
|
} |
102 |
< |
viewloc(ip, &myview, wp); /* frustum clipping */ |
103 |
< |
if (ip[2] < 0.) |
104 |
< |
continue; |
105 |
< |
if (ip[0] < 0. || ip[0] >= 1.) |
106 |
< |
continue; |
107 |
< |
if (ip[1] < 0. || ip[1] >= 1.) |
108 |
< |
continue; |
102 |
> |
if (viewloc(ip, &myview, wp) != 1) |
103 |
> |
continue; /* frustum clipping */ |
104 |
|
if (myview.vaft > FTINY && ip[2] > myview.vaft - myview.vfore) |
105 |
|
continue; /* not exact for VT_PER */ |
106 |
|
p = (int)(ip[1]*vres)*hres + (int)(ip[0]*hres); |
125 |
|
kill_occl( /* check for occlusion errors */ |
126 |
|
int h, |
127 |
|
int v, |
128 |
< |
register short nl[NNEIGH][2], |
128 |
> |
short nl[NNEIGH][2], |
129 |
|
int nd[NNEIGH], |
130 |
|
int n, |
131 |
|
double *rf |
133 |
|
{ |
134 |
|
short forequad[2][2]; |
135 |
|
int d; |
136 |
< |
register int i; |
137 |
< |
register int32 p; |
136 |
> |
int i; |
137 |
> |
int32 p; |
138 |
|
|
139 |
|
if (n <= 0) { |
140 |
|
#ifdef DEBUG |
161 |
|
smooth_samp( /* grow sample point smoothly */ |
162 |
|
int h, |
163 |
|
int v, |
164 |
< |
register short nl[NNEIGH][2], |
164 |
> |
short nl[NNEIGH][2], |
165 |
|
int nd[NNEIGH], |
166 |
|
int n, |
167 |
|
double *rf |
171 |
|
COLOR mykern[MAXRAD2]; |
172 |
|
int maxr2; |
173 |
|
double d; |
174 |
< |
register int32 p; |
175 |
< |
register int r2; |
174 |
> |
int32 p; |
175 |
> |
int r2; |
176 |
|
int i, r, maxr, h2, v2; |
177 |
|
|
178 |
|
if (n <= 0) |
226 |
|
random_samp( /* gather samples randomly */ |
227 |
|
int h, |
228 |
|
int v, |
229 |
< |
register short nl[NNEIGH][2], |
229 |
> |
short nl[NNEIGH][2], |
230 |
|
int nd[NNEIGH], |
231 |
|
int n, |
232 |
|
double *rf |
234 |
|
{ |
235 |
|
float rnt[NNEIGH]; |
236 |
|
double rvar; |
237 |
< |
register int32 p, pn; |
238 |
< |
register int ni; |
237 |
> |
int32 p, pn; |
238 |
> |
int ni; |
239 |
|
|
240 |
|
if (n <= 0) |
241 |
|
return(1); |
258 |
|
} |
259 |
|
|
260 |
|
|
261 |
< |
extern void |
261 |
> |
void |
262 |
|
pixFinish( /* done with beams -- compute pixel values */ |
263 |
|
double ransamp |
264 |
|
) |
280 |
|
static void |
281 |
|
reset_flags(void) /* allocate/set/reset occupancy flags */ |
282 |
|
{ |
283 |
< |
register int32 p; |
283 |
> |
int32 p; |
284 |
|
|
285 |
|
if (pixFlags == NULL) { |
286 |
|
pixFlags = (int32 *)calloc(FL4NELS(hres*vres), sizeof(int32)); |
296 |
|
static void |
297 |
|
init_wfunc(void) /* initialize weighting function */ |
298 |
|
{ |
299 |
< |
register int r2; |
300 |
< |
register double d; |
299 |
> |
int r2; |
300 |
> |
double d; |
301 |
|
|
302 |
|
for (r2 = MAXRAD2; --r2; ) { |
303 |
|
d = sqrt((double)r2); |
315 |
|
int nd[NNEIGH], |
316 |
|
int h, |
317 |
|
int v, |
318 |
< |
register short (*rnl)[NNEIGH] |
318 |
> |
short (*rnl)[NNEIGH] |
319 |
|
) |
320 |
|
{ |
321 |
|
int nn = 0; |
322 |
|
int d, n, hoff; |
323 |
< |
register int h2, n2; |
323 |
> |
int h2, n2; |
324 |
|
|
325 |
|
nd[NNEIGH-1] = MAXRAD2; |
326 |
|
for (hoff = 0; hoff < hres; hoff = (hoff<=0) - hoff) { |
362 |
|
short ln[NNEIGH][2]; |
363 |
|
int nd[NNEIGH]; |
364 |
|
int h, v, n, v2; |
365 |
< |
register short (*rnl)[NNEIGH]; |
365 |
> |
short (*rnl)[NNEIGH]; |
366 |
|
/* initialize bottom row list */ |
367 |
|
rnl = (short (*)[NNEIGH])malloc(NNEIGH*sizeof(short)*hres); |
368 |
|
CHECK(rnl==NULL, SYSTEM, "out of memory in meet_neighbors"); |