aboutsummaryrefslogtreecommitdiff
path: root/src/engine/TODO/maths.h
diff options
context:
space:
mode:
authorUnavailableDev <ggwildplay@gmail.com>2023-03-10 14:08:14 +0100
committerUnavailableDev <ggwildplay@gmail.com>2023-03-10 14:08:14 +0100
commit19737533abb3eeb90c97691618336b5cead14656 (patch)
tree01963569ac9bb4cb7e90744b06bdd6aba0560421 /src/engine/TODO/maths.h
parent1fdac4d8ab609e8d496918929eb963be3f3a824f (diff)
parent4a740898621dcfc16fe257b6fe8695c768ec4dd6 (diff)
merge
Diffstat (limited to 'src/engine/TODO/maths.h')
-rw-r--r--src/engine/TODO/maths.h16
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))