diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2023-03-11 11:20:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 11:20:15 +0100 |
commit | 835cd8a4cf7052d4599ab4fc2004922336766c21 (patch) | |
tree | bc8496a55007eb33bda49fda090dd79dab251fef /src/engine/maths.h | |
parent | b3720679f4148b8ba874f486de051c7df527e4bb (diff) | |
parent | e1f6e318c47d382299ba963a84379982113f0f4b (diff) |
Merge branch 'lonkaars:dev' into game-engine
Diffstat (limited to 'src/engine/maths.h')
-rw-r--r-- | src/engine/maths.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/engine/maths.h b/src/engine/maths.h new file mode 100644 index 0000000..c7f1b44 --- /dev/null +++ b/src/engine/maths.h @@ -0,0 +1,17 @@ +#pragma once +#include <stdint.h> +// #include <math.h> + +typedef struct { + uint32_t x,y; +} vec2; + +typedef vec2 vec_cen;//centered +typedef vec2 vec_cor;//left upper corner + +//fixed point at decimal 7lsb (world positions in pixels (with fixed decimal point)) +#define HH_MATH_FIXED_POINT 7 + +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) +#define CLAMP(N,LOWER,UPPER) (MIN(MAX(LOWER, N), UPPER)) |