146 |
|
return(gcol); |
147 |
|
} |
148 |
|
|
149 |
+ |
static void |
150 |
+ |
recolor( /* recolor the given node */ |
151 |
+ |
PNODE *p |
152 |
+ |
) |
153 |
+ |
{ |
154 |
+ |
while (p->kid != NULL) { /* need to propogate down */ |
155 |
+ |
int mx = (p->xmin + p->xmax) >> 1; |
156 |
+ |
int my = (p->ymin + p->ymax) >> 1; |
157 |
+ |
int ki; |
158 |
+ |
if (p->x >= mx) |
159 |
+ |
ki = (p->y >= my) ? UR : DR; |
160 |
+ |
else |
161 |
+ |
ki = (p->y >= my) ? UL : DL; |
162 |
+ |
pcopy(p, p->kid+ki); |
163 |
+ |
p = p->kid + ki; |
164 |
+ |
} |
165 |
|
|
166 |
+ |
(*dev->paintr)(greyscale?greyof(p->v):p->v, |
167 |
+ |
p->xmin, p->ymin, p->xmax, p->ymax); |
168 |
+ |
} |
169 |
+ |
|
170 |
|
int |
171 |
|
paint( /* compute and paint a rectangle */ |
172 |
|
PNODE *p |
206 |
|
copycolor(p->v, thisray.rcol); |
207 |
|
scalecolor(p->v, exposure); |
208 |
|
|
209 |
< |
while (p->kid != NULL) { /* need to propogate down */ |
190 |
< |
int mx = (p->xmin + p->xmax) >> 1; |
191 |
< |
int my = (p->ymin + p->ymax) >> 1; |
192 |
< |
int ki; |
193 |
< |
if (p->x >= mx) |
194 |
< |
ki = (p->y >= my) ? UR : DR; |
195 |
< |
else |
196 |
< |
ki = (p->y >= my) ? UL : DL; |
197 |
< |
pcopy(p, p->kid+ki); |
198 |
< |
p = p->kid + ki; |
199 |
< |
} |
209 |
> |
recolor(p); /* paint it */ |
210 |
|
|
201 |
– |
(*dev->paintr)(greyscale?greyof(p->v):p->v, |
202 |
– |
p->xmin, p->ymin, p->xmax, p->ymax); |
203 |
– |
|
211 |
|
if (ambounce <= 0) /* shall we check for input? */ |
212 |
|
flushintvl = ray_pnprocs*WFLUSH; |
213 |
|
else if (niflush < WFLUSH) |
235 |
|
PNODE *p = (PNODE *)raydone.rno; |
236 |
|
copycolor(p->v, raydone.rcol); |
237 |
|
scalecolor(p->v, exposure); |
238 |
< |
(*dev->paintr)(greyscale?greyof(p->v):p->v, |
232 |
< |
p->xmin, p->ymin, p->xmax, p->ymax); |
238 |
> |
recolor(p); |
239 |
|
nwaited++; |
240 |
|
} |
241 |
|
if (rval < 0) |