From 252ec68e84ce9d485a6d941e2f5ab8bd486fc172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 11 May 2019 15:00:25 +0200 Subject: [PATCH] PC seems working --- s3l.h | 8 ++------ testSDL.c | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/s3l.h b/s3l.h index e6fa259..acd791f 100644 --- a/s3l.h +++ b/s3l.h @@ -860,7 +860,6 @@ void _S3L_drawFilledTriangle( int16_t aDy = S3L_nonZero(y##a - y##t);\ int16_t bDy = S3L_nonZero(y##b - y##t);\ if ((aDx << 4) / aDy < (bDx << 4) / bDy)\ - /*if (x##a <= x##b)*/\ {\ lPointSx = x##a; lPointSy = y##a;\ rPointSx = x##b; rPointSy = y##b;\ @@ -1002,7 +1001,6 @@ void _S3L_drawFilledTriangle( #if S3L_PERSPECTIVE_CORRECTION == 1 S3L_PerspectiveCorrectionState lPC, rPC, rowPC; - int8_t topPart = 1; // whether drawing top or bottom part of the triangle initPC(t,l,l) initPC(t,r,r) @@ -1029,9 +1027,8 @@ void _S3L_drawFilledTriangle( manageSplit(0,2,r) #if S3L_PERSPECTIVE_CORRECTION == 1 - initPC(l,r,l) + initPC(r,l,l) initPC(r,t,r) - topPart = 0; #endif } else @@ -1040,9 +1037,8 @@ void _S3L_drawFilledTriangle( manageSplit(1,2,l) #if S3L_PERSPECTIVE_CORRECTION == 1 - initPC(r,l,r) + initPC(l,r,r) initPC(l,t,l) - topPart = 0; #endif } } diff --git a/testSDL.c b/testSDL.c index 592963c..0df898c 100644 --- a/testSDL.c +++ b/testSDL.c @@ -123,7 +123,7 @@ void draw() modelTransform.rotation.x = frame * 0.3; S3L_drawModelIndexed(ver,tri,12,modelTransform,&camera,&conf); -// S3L_drawModelIndexed(ver,tri + 3,1,modelTransform,&camera,&conf); +// S3L_drawModelIndexed(ver,tri,1,modelTransform,&camera,&conf); /* conf.backfaceCulling = S3L_BACKFACE_CULLING_NONE;