1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-21 20:39:57 +01:00

Fix minor things

This commit is contained in:
Miloslav Číž 2019-05-06 00:41:07 +02:00
parent a0ccae315b
commit 529c02a7a4

6
s3l.h
View file

@ -121,7 +121,7 @@ typedef int32_t S3L_Unit; /**< Units of measurement in 3D space. There is
it will overflow. Also other things
may overflow, so rather don't do it. */
#define S3L_NONZERO(value) ((value) != 0 ? (value) : 1) /**< prevents division
#define S3L_nonzero(value) ((value) != 0 ? (value) : 1) /**< prevents division
by zero */
#define S3L_SIN_TABLE_LENGTH 128
@ -841,9 +841,7 @@ void S3L_drawTriangle(
// draw the horizontal line
S3L_Unit tMax = rX - lX;
tMax = S3L_NONZERO(tMax); // prevent division by zero
S3L_Unit tMax = S3L_nonzero(rX - lX - 1); // prevent division by zero
S3L_Unit t1 = 0;
S3L_Unit t2 = tMax;