17 |
|
void pict_stats(void); |
18 |
|
|
19 |
|
static struct srcspan * newspan(int l, int r, int v, float *sb); |
20 |
– |
static struct srcspan * newspan(int l, int r, int v, float *sb); |
20 |
|
static void addindirect(int h, int v, double br); |
21 |
|
static void addsrcspan(struct srcspan *nss); |
22 |
|
static void mergesource(struct source *sp, struct source *ap); |
23 |
|
static void close_sources(int v); |
24 |
|
static void close_allsrcs(void); |
25 |
< |
static struct srcspan * splitspan(register struct srcspan *sso, double h, double v, double m); |
25 |
> |
static struct srcspan * splitspan(struct srcspan *sso, double h, double v, double m); |
26 |
|
static struct source * splitsource(struct source *so); |
27 |
< |
static void donesource(register struct source *sp); |
28 |
< |
static struct source * findbuddy(register struct source *s, register struct source *l); |
29 |
< |
static void absorb(register struct source *s); |
27 |
> |
static void donesource(struct source *sp); |
28 |
> |
static struct source * findbuddy(struct source *s, struct source *l); |
29 |
> |
static void absorb(struct source *s); |
30 |
|
static void freespans(struct source *sp); |
31 |
|
|
32 |
|
|
38 |
|
float *sb |
39 |
|
) |
40 |
|
{ |
41 |
< |
register struct srcspan *ss; |
42 |
< |
register int i; |
41 |
> |
struct srcspan *ss; |
42 |
> |
int i; |
43 |
|
|
44 |
|
ss = (struct srcspan *)malloc(sizeof(struct srcspan)); |
45 |
|
if (ss == NULL) |
54 |
|
} |
55 |
|
|
56 |
|
|
57 |
< |
extern void |
57 |
> |
void |
58 |
|
analyze(void) /* analyze our scene */ |
59 |
|
{ |
60 |
|
int h, v; |
111 |
|
{ |
112 |
|
double tanb, d; |
113 |
|
int hl; |
114 |
< |
register int i; |
114 |
> |
int i; |
115 |
|
|
116 |
|
hl = hlim(v); |
117 |
|
if (h <= -hl) { /* left region */ |
153 |
|
} |
154 |
|
|
155 |
|
|
156 |
< |
extern void |
156 |
> |
void |
157 |
|
comp_thresh(void) /* compute glare threshold */ |
158 |
|
{ |
159 |
|
int h, v; |
199 |
|
) |
200 |
|
{ |
201 |
|
struct source *last, *cs, *this; |
202 |
< |
register struct srcspan *ss; |
202 |
> |
struct srcspan *ss; |
203 |
|
|
204 |
|
cs = NULL; |
205 |
|
for (this = curlist; this != NULL; this = this->next) { |
240 |
|
) |
241 |
|
{ |
242 |
|
struct srcspan head; |
243 |
< |
register struct srcspan *alp, *prev, *tp; |
243 |
> |
struct srcspan *alp, *prev, *tp; |
244 |
|
|
245 |
|
head.next = sp->first; |
246 |
|
prev = &head; |
276 |
|
) |
277 |
|
{ |
278 |
|
struct source head; |
279 |
< |
register struct source *last, *this; |
279 |
> |
struct source *last, *this; |
280 |
|
|
281 |
|
head.next = curlist; |
282 |
|
last = &head; |
294 |
|
static void |
295 |
|
close_allsrcs(void) /* done with everything */ |
296 |
|
{ |
297 |
< |
register struct source *this, *next; |
297 |
> |
struct source *this, *next; |
298 |
|
|
299 |
|
this = curlist; |
300 |
|
while (this != NULL) { |
308 |
|
|
309 |
|
static struct srcspan * |
310 |
|
splitspan( /* divide source span at point */ |
311 |
< |
register struct srcspan *sso, |
311 |
> |
struct srcspan *sso, |
312 |
|
double h, |
313 |
|
double v, |
314 |
|
double m |
315 |
|
) |
316 |
|
{ |
317 |
< |
register struct srcspan *ssn; |
317 |
> |
struct srcspan *ssn; |
318 |
|
double d; |
319 |
|
int hs; |
320 |
|
|
344 |
|
{ |
345 |
|
LRSUM lr; |
346 |
|
LRLIN fit; |
347 |
< |
register struct srcspan *ss, *ssn; |
347 |
> |
struct srcspan *ss, *ssn; |
348 |
|
struct srcspan *ssl, *ssnl, head; |
349 |
|
int h; |
350 |
|
double mh, mv; |
392 |
|
|
393 |
|
static void |
394 |
|
donesource( /* finished with this source */ |
395 |
< |
register struct source *sp |
395 |
> |
struct source *sp |
396 |
|
) |
397 |
|
{ |
398 |
|
struct source *newsrc; |
399 |
< |
register struct srcspan *ss; |
399 |
> |
struct srcspan *ss; |
400 |
|
int h, n; |
401 |
|
double hsum, vsum, d; |
402 |
|
|
435 |
|
|
436 |
|
static struct source * |
437 |
|
findbuddy( /* find close enough source to s in l*/ |
438 |
< |
register struct source *s, |
439 |
< |
register struct source *l |
438 |
> |
struct source *s, |
439 |
> |
struct source *l |
440 |
|
) |
441 |
|
{ |
442 |
|
struct source *bestbuddy = NULL; |
454 |
|
} |
455 |
|
|
456 |
|
|
457 |
< |
extern void |
457 |
> |
void |
458 |
|
absorb_specks(void) /* eliminate too-small sources */ |
459 |
|
{ |
460 |
|
struct source head, *buddy; |
461 |
< |
register struct source *last, *this; |
461 |
> |
struct source *last, *this; |
462 |
|
|
463 |
|
if (verbose) |
464 |
|
fprintf(stderr, "%s: absorbing small sources...\n", progname); |
481 |
|
|
482 |
|
static void |
483 |
|
absorb( /* absorb a source into indirect */ |
484 |
< |
register struct source *s |
484 |
> |
struct source *s |
485 |
|
) |
486 |
|
{ |
487 |
|
FVECT dir; |
488 |
|
double d; |
489 |
< |
register int i; |
489 |
> |
int i; |
490 |
|
|
491 |
|
for (i = 0; i < nglardirs; i++) { |
492 |
|
spinvector(dir, ourview.vdir, ourview.vup, indirect[i].theta); |
506 |
|
struct source *sp |
507 |
|
) |
508 |
|
{ |
509 |
< |
register struct srcspan *ss; |
509 |
> |
struct srcspan *ss; |
510 |
|
|
511 |
|
while ((ss = sp->first) != NULL) { |
512 |
|
sp->first = ss->next; |