mirror of
https://git.coom.tech/drummyfish/small3dlib.git
synced 2024-11-21 20:39:57 +01:00
Clean up
This commit is contained in:
parent
545ff0d137
commit
cd7cf6ef01
4 changed files with 5 additions and 21 deletions
|
@ -7,9 +7,7 @@
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#define S3L_FLAT 0
|
#define S3L_FLAT 0
|
||||||
#define S3L_STRICT_NEAR_CULLING 0
|
#define S3L_STRICT_NEAR_CULLING 0
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#define S3L_STRICT_NEAR_CULLING 0
|
#define S3L_STRICT_NEAR_CULLING 0
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#define S3L_STRICT_NEAR_CULLING 0
|
#define S3L_STRICT_NEAR_CULLING 0
|
||||||
|
@ -240,15 +239,7 @@ int main()
|
||||||
levelModelInit();
|
levelModelInit();
|
||||||
|
|
||||||
S3L_initScene(&levelModel,1,&scene);
|
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;
|
int running = 1;
|
||||||
|
|
||||||
while (running) // main loop
|
while (running) // main loop
|
||||||
|
|
13
small3dlib.h
13
small3dlib.h
|
@ -1489,9 +1489,8 @@ void S3L_initTransoform3D(S3L_Transform3D *t)
|
||||||
t->scale.w = 0;
|
t->scale.w = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Performs perspecive division (z-divide). Does NOT check for division by
|
||||||
Performs perspecive division (z-divide). Does NOT check for division by zero.
|
zero. */
|
||||||
*/
|
|
||||||
static inline void S3L_perspectiveDivide(S3L_Vec4 *vector,
|
static inline void S3L_perspectiveDivide(S3L_Vec4 *vector,
|
||||||
S3L_Unit focalLength)
|
S3L_Unit focalLength)
|
||||||
{
|
{
|
||||||
|
@ -2047,7 +2046,6 @@ void S3L_drawTriangle(
|
||||||
|
|
||||||
b0FLS.stepScaled = rSideFLS.valueScaled / rowLength;
|
b0FLS.stepScaled = rSideFLS.valueScaled / rowLength;
|
||||||
b1FLS.stepScaled = -1 * lSideFLS.valueScaled / rowLength;
|
b1FLS.stepScaled = -1 * lSideFLS.valueScaled / rowLength;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2201,7 +2199,7 @@ void S3L_drawTriangle(
|
||||||
S3L_stepFastLerp(depthFLS);
|
S3L_stepFastLerp(depthFLS);
|
||||||
#endif
|
#endif
|
||||||
#else // !S3L_COMPUTE_DEPTH
|
#else // !S3L_COMPUTE_DEPTH
|
||||||
p.depth = (tPointSS->z + lPointSS->z + rPointSS->z) / 3;
|
p.depth = (tPointSS->z + lPointSS->z + rPointSS->z) / 3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if S3L_Z_BUFFER
|
#if S3L_Z_BUFFER
|
||||||
|
@ -2256,9 +2254,8 @@ void S3L_drawTriangle(
|
||||||
S3L_stepFastLerp(b1FLS);
|
S3L_stepFastLerp(b1FLS);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
} // inner loop
|
||||||
} // inner loop
|
} // y clipping
|
||||||
} // y clipping
|
|
||||||
|
|
||||||
S3L_stepFastLerp(lSideFLS);
|
S3L_stepFastLerp(lSideFLS);
|
||||||
S3L_stepFastLerp(rSideFLS);
|
S3L_stepFastLerp(rSideFLS);
|
||||||
|
|
Loading…
Reference in a new issue