aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/util.h b/src/util.h
index 9e84a7c..5e661a3 100644
--- a/src/util.h
+++ b/src/util.h
@@ -9,21 +9,15 @@ struct timespec timespec_diff(struct timespec a, struct timespec b);
bool timespec_greater(struct timespec a, struct timespec b);
+void timespec_print(struct timespec *ts);
+
// Check if point (px, py) is inside a rectangle in (x, y), (x+w, y), (x, y+h) and (w+h, y+h)
-static inline bool in_rect(int px, int py, int x, int y, int w, int h)
-{
- return px >= x && px <= x + w && py >= y && py <= y + h;
-}
+bool check_rect(int px, int py, int x, int y, int w, int h);
// Check if point (px, py) is inside a circle of radius r and center (x, y)
-static inline bool in_circle(int px, int py, int x, int y, int r)
-{
- int dx = x - px;
- int dy = y - py;
- return (dx * dx + dy * dy) <= r * r;
-}
+bool check_circle(int px, int py, int x, int y, int r);
// Check if point (px, py) is inside a capsule in (x, y), (x+w, y), (x, y+h) and (w+h, y+h)
-bool in_capsule(int px, int py, int x, int y, int w, int h);
+bool check_capsule(int px, int py, int x, int y, int w, int h);
#endif