From 40739dbb5eda08aec6224361a836c7bd2ca38c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 1 Jun 2019 23:04:59 +0200 Subject: [PATCH] Add check --- small3dlib.h | 2 ++ testSDL.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/small3dlib.h b/small3dlib.h index 8ef3cce..43f0382 100644 --- a/small3dlib.h +++ b/small3dlib.h @@ -1196,9 +1196,11 @@ void S3L_drawTriangle( p.modelID = modelID; p.triangleID = triangleID; +#if !S3L_STRICT_NEAR_CULLING point0.z = point0.z >= S3L_NEAR ? point0.z : S3L_NEAR; point1.z = point1.z >= S3L_NEAR ? point1.z : S3L_NEAR; point2.z = point2.z >= S3L_NEAR ? point2.z : S3L_NEAR; +#endif S3L_Vec4 *tPointPP, *lPointPP, *rPointPP; /* points in projction plane space (in Units, normalized by diff --git a/testSDL.c b/testSDL.c index ea75d54..f35abef 100644 --- a/testSDL.c +++ b/testSDL.c @@ -10,9 +10,10 @@ //#define S3L_PRESET_HIGHEST_QUALITY -#define S3L_PERSPECTIVE_CORRECTION 1 -#define S3L_Z_BUFFER 1 -#define S3L_SORT 0 +#define S3L_STRICT_NEAR_CULLING 0 +#define S3L_PERSPECTIVE_CORRECTION 0 +#define S3L_SORT 1 +#define S3L_Z_BUFFER 0 #define S3L_PIXEL_FUNCTION drawPixel