diff --git a/programs/make.sh b/programs/make.sh index 6e5b564..3d9b92e 100755 --- a/programs/make.sh +++ b/programs/make.sh @@ -1,5 +1,6 @@ #!/bin/bash -PROGRAM=testSDL +PROGRAM=helloTerminal -clear; clear; g++ -x c -g -fmax-errors=5 -pedantic -Wall -Wextra -o $PROGRAM $PROGRAM.c -lSDL2 2>&1 >/dev/null && ./$PROGRAM +clear; clear; g++ -x c -g -fmax-errors=5 -pedantic -O3 -Wall -Wextra -o $PROGRAM $PROGRAM.c -lSDL2 2>&1 >/dev/null && ./$PROGRAM +#clear; clear; clang -x c -g -pedantic -O3 -Wall -Wextra -o $PROGRAM $PROGRAM.c -lSDL2 2>&1 >/dev/null && ./$PROGRAM diff --git a/small3dlib.h b/small3dlib.h index 034f477..3452240 100644 --- a/small3dlib.h +++ b/small3dlib.h @@ -1286,9 +1286,12 @@ S3L_Unit S3L_sin(S3L_Unit x) int8_t positive = 1; if (x < S3L_SIN_TABLE_LENGTH) - x = x; + { + } else if (x < S3L_SIN_TABLE_LENGTH * 2) + { x = S3L_SIN_TABLE_LENGTH * 2 - x - 1; + } else if (x < S3L_SIN_TABLE_LENGTH * 3) { x = x - S3L_SIN_TABLE_LENGTH * 2;