aboutsummaryrefslogtreecommitdiff
path: root/src/engine/maths.h
diff options
context:
space:
mode:
authorFlenk008 <frenk_0_0@hotmail.com>2023-03-11 20:59:29 +0100
committerGitHub <noreply@github.com>2023-03-11 20:59:29 +0100
commit19bc4a3a13d17422cfa9b2a9fcede95d4c83e822 (patch)
treef285c0e9e564a09109910b0850ae513f503e126d /src/engine/maths.h
parentc12ff10740927c6040c83b3399ad35e94117131c (diff)
parente1f6e318c47d382299ba963a84379982113f0f4b (diff)
Merge branch 'lonkaars:dev' into dev
Diffstat (limited to 'src/engine/maths.h')
-rw-r--r--src/engine/maths.h17
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))