From cd7cf6ef01353f0d44270013a21e83b7dfdece1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Fri, 28 Jun 2019 17:32:45 +0200 Subject: [PATCH] Clean up --- programs/city.c | 2 -- programs/highPoly.c | 2 -- programs/level.c | 9 --------- small3dlib.h | 13 +++++-------- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/programs/city.c b/programs/city.c index bd2b842..c20ee14 100644 --- a/programs/city.c +++ b/programs/city.c @@ -7,9 +7,7 @@ #include #include -#include #include -#include #define S3L_FLAT 0 #define S3L_STRICT_NEAR_CULLING 0 diff --git a/programs/highPoly.c b/programs/highPoly.c index 32fde45..b966149 100644 --- a/programs/highPoly.c +++ b/programs/highPoly.c @@ -6,8 +6,6 @@ */ #include -#include -#include #define S3L_STRICT_NEAR_CULLING 0 diff --git a/programs/level.c b/programs/level.c index 6722588..2bfaea0 100644 --- a/programs/level.c +++ b/programs/level.c @@ -9,7 +9,6 @@ #include #include -#include #include #define S3L_STRICT_NEAR_CULLING 0 @@ -240,15 +239,7 @@ int main() levelModelInit(); S3L_initScene(&levelModel,1,&scene); -/* - S3L_Unit s = S3L_FRACTIONS_PER_UNIT / 3; - S3L_Vec4 scale; - - S3L_setVec4(&scale,s,s,s,S3L_FRACTIONS_PER_UNIT); - - scene.models[0].transform.scale = scale; -*/ int running = 1; while (running) // main loop diff --git a/small3dlib.h b/small3dlib.h index 3c6746d..aa64575 100644 --- a/small3dlib.h +++ b/small3dlib.h @@ -1489,9 +1489,8 @@ void S3L_initTransoform3D(S3L_Transform3D *t) t->scale.w = 0; } -/** - Performs perspecive division (z-divide). Does NOT check for division by zero. -*/ +/** Performs perspecive division (z-divide). Does NOT check for division by + zero. */ static inline void S3L_perspectiveDivide(S3L_Vec4 *vector, S3L_Unit focalLength) { @@ -2047,7 +2046,6 @@ void S3L_drawTriangle( b0FLS.stepScaled = rSideFLS.valueScaled / rowLength; b1FLS.stepScaled = -1 * lSideFLS.valueScaled / rowLength; - #endif #endif @@ -2201,7 +2199,7 @@ void S3L_drawTriangle( S3L_stepFastLerp(depthFLS); #endif #else // !S3L_COMPUTE_DEPTH - p.depth = (tPointSS->z + lPointSS->z + rPointSS->z) / 3; + p.depth = (tPointSS->z + lPointSS->z + rPointSS->z) / 3; #endif #if S3L_Z_BUFFER @@ -2256,9 +2254,8 @@ void S3L_drawTriangle( S3L_stepFastLerp(b1FLS); #endif #endif - - } // inner loop - } // y clipping + } // inner loop + } // y clipping S3L_stepFastLerp(lSideFLS); S3L_stepFastLerp(rSideFLS);