diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2023-03-11 11:19:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 11:19:38 +0100 |
commit | e1f6e318c47d382299ba963a84379982113f0f4b (patch) | |
tree | 12946a4d8c446a0957a02aa13a057a42571f3ad4 /src/engine/maths.h | |
parent | 3c7f8d25c226510bd391c6b61e89e7f732ce3072 (diff) | |
parent | f4e4b53fe3ef96a7bd2d4052c5a181f05945a0aa (diff) |
Merge pull request #30 from heavydemon21/dev
Dev
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)) |