1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-23 20:59:58 +01:00

Tidy macros

This commit is contained in:
Miloslav Číž 2019-06-10 20:15:04 +02:00
parent eadd5685fa
commit 1866d11bed
2 changed files with 7 additions and 5 deletions

View file

@ -1763,7 +1763,7 @@ void S3L_drawTriangle(
initSide(r,t,r,1) initSide(r,t,r,1)
initSide(l,t,l,1) initSide(l,t,l,1)
#if S3L_PERSPECTIVE_CORRECTION != 0 #if S3L_PERSPECTIVE_CORRECTION
/* PC is done by linearly interpolating reciprocals from which the corrected /* PC is done by linearly interpolating reciprocals from which the corrected
velues can be computed. See velues can be computed. See
http://www.lysator.liu.se/~mikaelk/doc/perspectivetexture/ */ http://www.lysator.liu.se/~mikaelk/doc/perspectivetexture/ */
@ -1847,7 +1847,7 @@ void S3L_drawTriangle(
#if !S3L_FLAT #if !S3L_FLAT
S3L_Unit rowLength = S3L_nonZero(rX - lX - 1); // prevent zero div S3L_Unit rowLength = S3L_nonZero(rX - lX - 1); // prevent zero div
#if S3L_PERSPECTIVE_CORRECTION != 0 #if S3L_PERSPECTIVE_CORRECTION
S3L_Unit lOverZ, lRecipZ, rOverZ, rRecipZ, lT, rT; S3L_Unit lOverZ, lRecipZ, rOverZ, rRecipZ, lT, rT;
lT = S3L_getFastLerpValue(lSideFLS); lT = S3L_getFastLerpValue(lSideFLS);
@ -1887,7 +1887,7 @@ void S3L_drawTriangle(
{ {
lXClipped = 0; lXClipped = 0;
#if S3L_PERSPECTIVE_CORRECTION == 0 && !S3L_FLAT #if !S3L_PERSPECTIVE_CORRECTION && !S3L_FLAT
b0FLS.valueScaled -= lX * b0FLS.stepScaled; b0FLS.valueScaled -= lX * b0FLS.stepScaled;
b1FLS.valueScaled -= lX * b1FLS.stepScaled; b1FLS.valueScaled -= lX * b1FLS.stepScaled;
@ -1897,7 +1897,7 @@ void S3L_drawTriangle(
#endif #endif
} }
#if S3L_PERSPECTIVE_CORRECTION != 0 #if S3L_PERSPECTIVE_CORRECTION
S3L_ScreenCoord i = lXClipped - lX; /* helper var to save one S3L_ScreenCoord i = lXClipped - lX; /* helper var to save one
substraction in the inner substraction in the inner
loop */ loop */
@ -2034,7 +2034,7 @@ void S3L_drawTriangle(
} }
#if !S3L_FLAT #if !S3L_FLAT
#if S3L_PERSPECTIVE_CORRECTION != 0 #if S3L_PERSPECTIVE_CORRECTION
i++; i++;
#if S3L_PERSPECTIVE_CORRECTION == 2 #if S3L_PERSPECTIVE_CORRECTION == 2
rowCount++; rowCount++;

View file

@ -12,6 +12,8 @@ features:
- function to set/clear stencil buffer -- can be useful - function to set/clear stencil buffer -- can be useful
- Optimize persp. correction!
- Create and use the same function for determining CW/CCW AND left/right vertex - Create and use the same function for determining CW/CCW AND left/right vertex
determination in triangle drawing. determination in triangle drawing.