527 |
|
OBJREC *mnew, *mray; |
528 |
|
|
529 |
|
if ((t <= FTINY) | (t > r->rot + FTINY)) |
530 |
< |
return 1; |
530 |
> |
return(1); |
531 |
|
if (t < r->rot - FTINY) /* is new hit significantly closer? */ |
532 |
< |
return 0; |
533 |
< |
/* coincident, so decide... */ |
532 |
> |
return(0); |
533 |
> |
/* coincident point, so decide... */ |
534 |
|
if (o == r->ro) |
535 |
< |
return 1; /* shouldn't happen */ |
535 |
> |
return(1); /* shouldn't happen */ |
536 |
|
if (r->ro == NULL) |
537 |
< |
return 0; /* ditto */ |
538 |
< |
if ((mnew = findmaterial(o)) == NULL) |
539 |
< |
return 1; /* new has no material */ |
540 |
< |
if ((mray = findmaterial(r->ro)) == NULL) |
541 |
< |
return 0; /* old has no material(!) */ |
542 |
< |
if (istransp(mnew->otype)) |
543 |
< |
return 1; /* new is transparent */ |
544 |
< |
|
545 |
< |
return !istransp(mray->otype); /* reject unless old is */ |
537 |
> |
return(0); /* ditto */ |
538 |
> |
mnew = findmaterial(o); |
539 |
> |
mray = findmaterial(r->ro); /* check material transparencies */ |
540 |
> |
if (mnew == NULL) { |
541 |
> |
if (mray != NULL) |
542 |
> |
return(1); /* new has no material */ |
543 |
> |
} else if (mray == NULL) { |
544 |
> |
return(0); /* old has no material(!) */ |
545 |
> |
} else if (istransp(mnew->otype)) { |
546 |
> |
if (!istransp(mray->otype)) |
547 |
> |
return(1); /* new is transparent */ |
548 |
> |
} else if (istransp(mray->otype)) { |
549 |
> |
return(0); /* old is transparent */ |
550 |
> |
} |
551 |
> |
/* weakest priority to later modifier definition */ |
552 |
> |
return (r->ro->omod >= o->omod); |
553 |
|
} |
554 |
|
|
555 |
|
void |