From fa234f9663b992cf50bcf865a1cde6845b42193c Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 21 May 2018 16:02:00 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=94=B9audio=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/math/constant.h | 4 ++++ src/libjin/math/math.h | 7 ++++++- src/libjin/math/rect.h | 15 --------------- 3 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 src/libjin/math/rect.h (limited to 'src/libjin/math') 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 -- cgit v1.1-26-g67d0