146 |
|
int n; |
147 |
|
register int i; |
148 |
|
/* see if we can avoid select call */ |
149 |
+ |
flgs = 0; /* flag what's ready already */ |
150 |
|
if (imm_mode || stdin->_cnt > 0) |
151 |
< |
return(RDY_SRV); |
151 |
> |
flgs |= RDY_SRV; |
152 |
|
if (sstdin != NULL && sstdin->_cnt > 0) |
153 |
< |
return(RDY_SIN); |
154 |
< |
if (dev_flush()) |
153 |
> |
flgs |= RDY_SIN; |
154 |
> |
if (odev.inpready) |
155 |
> |
flgs |= RDY_DEV; |
156 |
> |
if (flgs) /* got something? */ |
157 |
> |
return(flgs); |
158 |
> |
if (dev_flush()) /* else flush output & check keyboard+mouse */ |
159 |
|
return(RDY_DEV); |
160 |
< |
/* make the call */ |
160 |
> |
/* if nothing, we need to call select */ |
161 |
|
FD_ZERO(&readset); FD_ZERO(&errset); |
162 |
|
FD_SET(0, &readset); |
163 |
|
FD_SET(0, &errset); |
176 |
|
return(0); |
177 |
|
error(SYSTEM, "select call failure in disp_wait"); |
178 |
|
} |
174 |
– |
flgs = 0; /* flag what's ready */ |
179 |
|
if (FD_ISSET(0, &readset) || FD_ISSET(0, &errset)) |
180 |
|
flgs |= RDY_SRV; |
181 |
|
if (FD_ISSET(odev.ifd, &readset) || FD_ISSET(odev.ifd, &errset)) |
238 |
|
for (i = p->nr; i--; ) { |
239 |
|
hdray(ro, rd, hdlist[p->hd], gc, packra(p)[i].r); |
240 |
|
d = hddepth(hdlist[p->hd], packra(p)[i].d); |
241 |
< |
VSUM(wp, ro, rd, d); /* might be behind viewpoint */ |
242 |
< |
dev_value(packra(p)[i].v, wp, rd); |
241 |
> |
if (d < .99*FHUGE) { |
242 |
> |
VSUM(wp, ro, rd, d); /* might be behind viewpoint */ |
243 |
> |
dev_value(packra(p)[i].v, rd, wp); |
244 |
> |
} else |
245 |
> |
dev_value(packra(p)[i].v, rd, NULL); |
246 |
|
} |
247 |
|
#ifdef DEBUG |
248 |
|
if (imm_mode) nimmrays += p->nr; |