aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/math
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/math')
-rw-r--r--src/libjin/math/constant.h4
-rw-r--r--src/libjin/math/math.h7
-rw-r--r--src/libjin/math/rect.h15
3 files changed, 10 insertions, 16 deletions
diff --git a/src/libjin/math/constant.h b/src/libjin/math/constant.h
index 74acaea..f2f740f 100644
--- a/src/libjin/math/constant.h
+++ b/src/libjin/math/constant.h
@@ -3,4 +3,8 @@
#define PI 3.1415926f
+// int16 Χ
+#define INT16_RANGE_LEFT -32768
+#define INT16_RANGE_RIGHT 32767
+
#endif \ No newline at end of file
diff --git a/src/libjin/math/math.h b/src/libjin/math/math.h
index fdf1725..f6a299e 100644
--- a/src/libjin/math/math.h
+++ b/src/libjin/math/math.h
@@ -6,6 +6,11 @@
#include "constant.h"
#include "matrix.h"
#include "quad.h"
-#include "rect.h"
+
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define clamp(a, mi,ma) min(max(a,mi),ma)
+#define within(a,min,max) (a >= min && a <= max)
+#define without(a,min,max) (a < min || a > max)
#endif \ No newline at end of file
diff --git a/src/libjin/math/rect.h b/src/libjin/math/rect.h
deleted file mode 100644
index 79c1df2..0000000
--- a/src/libjin/math/rect.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef __JIN_RECT_H
-#define __JIN_RECT_H
-
-namespace jin
-{
-namespace math
-{
- class Rect
- {
- public:
- int x, y, w, h;
- };
-}
-}
-#endif \ No newline at end of file