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:
parent
eadd5685fa
commit
1866d11bed
2 changed files with 7 additions and 5 deletions
10
small3dlib.h
10
small3dlib.h
|
@ -1763,7 +1763,7 @@ void S3L_drawTriangle(
|
|||
initSide(r,t,r,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
|
||||
velues can be computed. See
|
||||
http://www.lysator.liu.se/~mikaelk/doc/perspectivetexture/ */
|
||||
|
@ -1847,7 +1847,7 @@ void S3L_drawTriangle(
|
|||
#if !S3L_FLAT
|
||||
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;
|
||||
|
||||
lT = S3L_getFastLerpValue(lSideFLS);
|
||||
|
@ -1887,7 +1887,7 @@ void S3L_drawTriangle(
|
|||
{
|
||||
lXClipped = 0;
|
||||
|
||||
#if S3L_PERSPECTIVE_CORRECTION == 0 && !S3L_FLAT
|
||||
#if !S3L_PERSPECTIVE_CORRECTION && !S3L_FLAT
|
||||
b0FLS.valueScaled -= lX * b0FLS.stepScaled;
|
||||
b1FLS.valueScaled -= lX * b1FLS.stepScaled;
|
||||
|
||||
|
@ -1897,7 +1897,7 @@ void S3L_drawTriangle(
|
|||
#endif
|
||||
}
|
||||
|
||||
#if S3L_PERSPECTIVE_CORRECTION != 0
|
||||
#if S3L_PERSPECTIVE_CORRECTION
|
||||
S3L_ScreenCoord i = lXClipped - lX; /* helper var to save one
|
||||
substraction in the inner
|
||||
loop */
|
||||
|
@ -2034,7 +2034,7 @@ void S3L_drawTriangle(
|
|||
}
|
||||
|
||||
#if !S3L_FLAT
|
||||
#if S3L_PERSPECTIVE_CORRECTION != 0
|
||||
#if S3L_PERSPECTIVE_CORRECTION
|
||||
i++;
|
||||
#if S3L_PERSPECTIVE_CORRECTION == 2
|
||||
rowCount++;
|
||||
|
|
2
todo.txt
2
todo.txt
|
@ -12,6 +12,8 @@ features:
|
|||
|
||||
- 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
|
||||
determination in triangle drawing.
|
||||
|
||||
|
|
Loading…
Reference in a new issue