1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-21 20:39:57 +01:00

Fix ocassional wrong sort

This commit is contained in:
Miloslav Číž 2019-06-02 15:24:47 +02:00
parent 8d710ee3c7
commit 09479b7fa1

View file

@ -1277,11 +1277,11 @@ void S3L_drawTriangle(
tPointSy = y##t;\
tPointPP = &point##t;\
barycentric2 = &(p.barycentric[t]);\
int16_t aDx = x##a - x##t;\
int16_t bDx = x##b - x##t;\
int16_t aDy = S3L_nonZero(y##a - y##t);\
int16_t bDy = S3L_nonZero(y##b - y##t);\
if ((aDx << 5) / aDy < (bDx << 5) / bDy)\
int32_t aDx = x##a - x##t;\
int32_t bDx = x##b - x##t;\
int32_t aDy = S3L_nonZero(y##a - y##t);\
int32_t bDy = S3L_nonZero(y##b - y##t);\
if ((aDx << 8) / aDy < (bDx << 8) / bDy)\
{\
lPointSx = x##a; lPointSy = y##a;\
rPointSx = x##b; rPointSy = y##b;\