mirror of
https://git.coom.tech/drummyfish/small3dlib.git
synced 2024-12-22 01:26:17 +01:00
DrawTriangle update
This commit is contained in:
parent
526dc5f60d
commit
cca1c2fcd4
1 changed files with 11 additions and 9 deletions
20
small3dlib.h
20
small3dlib.h
|
@ -1928,13 +1928,13 @@ void S3L_drawTriangle(
|
|||
velues can be computed. See
|
||||
http://www.lysator.liu.se/~mikaelk/doc/perspectivetexture/ */
|
||||
|
||||
#if S3L_PERSPECTIVE_CORRECTION == 1
|
||||
#define Z_RECIP_NUMERATOR\
|
||||
(S3L_FRACTIONS_PER_UNIT * S3L_FRACTIONS_PER_UNIT * S3L_FRACTIONS_PER_UNIT)
|
||||
#elif S3L_PERSPECTIVE_CORRECTION == 2
|
||||
#define Z_RECIP_NUMERATOR\
|
||||
(S3L_FRACTIONS_PER_UNIT * S3L_FRACTIONS_PER_UNIT)
|
||||
#endif
|
||||
#if S3L_PERSPECTIVE_CORRECTION == 1
|
||||
#define Z_RECIP_NUMERATOR\
|
||||
(S3L_FRACTIONS_PER_UNIT * S3L_FRACTIONS_PER_UNIT * S3L_FRACTIONS_PER_UNIT)
|
||||
#elif S3L_PERSPECTIVE_CORRECTION == 2
|
||||
#define Z_RECIP_NUMERATOR\
|
||||
(S3L_FRACTIONS_PER_UNIT * S3L_FRACTIONS_PER_UNIT)
|
||||
#endif
|
||||
/* ^ This numerator is a number by which we divide values for the
|
||||
reciprocals. For PC == 2 it has to be lower because linear interpolation
|
||||
scaling would make it overflow -- this results in lower depth precision
|
||||
|
@ -2251,16 +2251,18 @@ void S3L_drawTriangle(
|
|||
} // inner loop
|
||||
} // y clipping
|
||||
|
||||
#if !S3L_FLAT
|
||||
S3L_stepFastLerp(lSideFLS);
|
||||
S3L_stepFastLerp(rSideFLS);
|
||||
|
||||
#if S3L_COMPUTE_LERP_DEPTH
|
||||
#if S3L_COMPUTE_LERP_DEPTH
|
||||
S3L_stepFastLerp(lDepthFLS);
|
||||
S3L_stepFastLerp(rDepthFLS);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
++currentY;
|
||||
}
|
||||
} // row drawing
|
||||
|
||||
#undef manageSplit
|
||||
#undef initPC
|
||||
|
|
Loading…
Reference in a new issue