mirror of
https://git.coom.tech/drummyfish/small3dlib.git
synced 2024-12-22 01:26:17 +01:00
Update the make script
This commit is contained in:
parent
f474f3530e
commit
e1d5e0b503
2 changed files with 26 additions and 8 deletions
|
@ -1,5 +1,23 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
PROGRAM=testTerminal # change this to name of a program you want to compile :)
|
||||
# Make script for small3dlib programs.
|
||||
# by drummyfish
|
||||
# released under CC0 1.0, public domain
|
||||
|
||||
clear; clear; g++ -x c -g -fmax-errors=5 -pedantic -O3 -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wno-unused-parameter -Wno-missing-field-initializers -o $PROGRAM $PROGRAM.c -lSDL2 2>&1 >/dev/null && ./$PROGRAM
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "ERROR: expecting one argument, the name of program without extension (e.g. \"helloWorld\")"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
link=""
|
||||
|
||||
clear
|
||||
clear
|
||||
|
||||
flags="-x c -g -O3 -std=c99 -pedantic -Wall -Wextra -o $1 $1.c -lSDL2"
|
||||
compiler=gcc
|
||||
#compiler=clang
|
||||
|
||||
echo "making:" ${compiler} ${flags}
|
||||
|
||||
${compiler} ${flags} && ./$1
|
||||
|
|
10
small3dlib.h
10
small3dlib.h
|
@ -178,7 +178,7 @@
|
|||
#define S3L_SIN_METHOD 0
|
||||
#endif
|
||||
|
||||
/** Units of measurement in 3D space. There is S3L_F in one
|
||||
/** Units of measurement in 3D space. There is S3L_FRACTIONS_PER_UNIT in one
|
||||
spatial unit. By dividing the unit into fractions we effectively achieve a
|
||||
fixed point arithmetic. The number of fractions is a constant that serves as
|
||||
1.0 in floating point arithmetic (normalization etc.). */
|
||||
|
@ -190,10 +190,10 @@ typedef
|
|||
int32_t
|
||||
#endif
|
||||
S3L_Unit;
|
||||
|
||||
/** How many fractions a spatial unit is split into. This is NOT SUPPOSED TO
|
||||
BE REDEFINED, so rather don't do it (otherwise things may overflow etc.). */
|
||||
|
||||
|
||||
/** How many fractions a spatial unit is split into, i.e. this is the fixed
|
||||
point scaling. This is NOT SUPPOSED TO BE REDEFINED, so rather don't do it
|
||||
(otherwise things may overflow etc.). */
|
||||
#define S3L_FRACTIONS_PER_UNIT 512
|
||||
#define S3L_F S3L_FRACTIONS_PER_UNIT
|
||||
|
||||
|
|
Loading…
Reference in a new issue