568 |
|
if (!cvtndx(v1i, v1) || !cvtndx(v2i, v2) || !cvtndx(v3i, v3)) |
569 |
|
return(0); |
570 |
|
/* compute barycentric coordinates */ |
571 |
< |
texOK = !flatten && (v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0); |
571 |
> |
if (!flatten && v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0) |
572 |
> |
switch (flat_tri(vlist[v1i[0]], vlist[v2i[0]], vlist[v3i[0]], |
573 |
> |
vnlist[v1i[2]], vnlist[v2i[2]], vnlist[v3i[2]])) { |
574 |
> |
case DEGEN: /* zero area */ |
575 |
> |
return(-1); |
576 |
> |
case RVFLAT: /* reversed normals, but flat */ |
577 |
> |
case ISFLAT: /* smoothing unnecessary */ |
578 |
> |
texOK = 0; |
579 |
> |
break; |
580 |
> |
case RVBENT: /* reversed normals with smoothing */ |
581 |
> |
case ISBENT: /* proper smoothing */ |
582 |
> |
texOK = 1; |
583 |
> |
break; |
584 |
> |
} |
585 |
> |
else |
586 |
> |
texOK = 0; |
587 |
|
#ifdef TEXMAPS |
588 |
|
patOK = mapname[0] && (v1i[1]>=0 && v2i[1]>=0 && v3i[1]>=0); |
589 |
|
#else |