Fix for Issue 73, Handle zero-height spans.

This commit is contained in:
Mikko Mononen 2010-05-05 13:15:40 +00:00
parent db0a8cdbd6
commit 87800abc28

View File

@ -261,7 +261,7 @@ static void rasterizeTri(const float* v0, const float* v1, const float* v2,
// Snap the span to the heightfield height grid.
unsigned short ismin = (unsigned short)rcClamp((int)floorf(smin * ich), 0, 0x7fff);
unsigned short ismax = (unsigned short)rcClamp((int)ceilf(smax * ich), 0, 0x7fff);
unsigned short ismax = (unsigned short)rcClamp((int)ceilf(smax * ich), (int)ismin+1, 0x7fff);
rcAddSpan(hf, x, y, ismin, ismax, flags, flagMergeThr);
}