diff options
author | UnavailableDev <ggwildplay@gmail.com> | 2023-03-10 14:08:14 +0100 |
---|---|---|
committer | UnavailableDev <ggwildplay@gmail.com> | 2023-03-10 14:08:14 +0100 |
commit | 19737533abb3eeb90c97691618336b5cead14656 (patch) | |
tree | 01963569ac9bb4cb7e90744b06bdd6aba0560421 /src/engine/TODO/maths.h | |
parent | 1fdac4d8ab609e8d496918929eb963be3f3a824f (diff) | |
parent | 4a740898621dcfc16fe257b6fe8695c768ec4dd6 (diff) |
merge
Diffstat (limited to 'src/engine/TODO/maths.h')
-rw-r--r-- | src/engine/TODO/maths.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/engine/TODO/maths.h b/src/engine/TODO/maths.h new file mode 100644 index 0000000..032e56d --- /dev/null +++ b/src/engine/TODO/maths.h @@ -0,0 +1,16 @@ +#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 + +#define HH_MATH_FIXED_POINT 7 //fixed point at decimal 7lsb (world positions in pixels (with fixed decimal point)) + +#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)) |