645 |
|
} else if (!(inFront | outFront)) { |
646 |
|
*sv = sd->rLambBack; |
647 |
|
sdf = sd->rb; |
648 |
< |
} else if (outFront) { |
648 |
> |
} else if (inFront) { |
649 |
|
*sv = sd->tLamb; |
650 |
|
sdf = (sd->tf != NULL) ? sd->tf : sd->tb; |
651 |
< |
} else /* inFront & !outFront */ { |
651 |
> |
} else /* outFront & !inFront */ { |
652 |
|
*sv = sd->tLamb; |
653 |
|
sdf = (sd->tb != NULL) ? sd->tb : sd->tf; |
654 |
|
} |
789 |
|
randX -= sd->tLamb.cieY; |
790 |
|
} |
791 |
|
/* else one of cumulative dist. */ |
792 |
< |
for (i = 0; i < n && randX > cdarr[i]->cTotal; i++) |
792 |
> |
for (i = 0; i < n && randX >= cdarr[i]->cTotal; i++) |
793 |
|
randX -= cdarr[i]->cTotal; |
794 |
|
if (i >= n) |
795 |
|
return SDEinternal; |