aboutsummaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2020-06-16 15:15:10 +0000
committerrodri <rgl@antares-labs.eu>2020-06-16 15:15:10 +0000
commit4f5035ffa4e67beba5489cf8a23f02c872595ed2 (patch)
tree1a0bc3e334f6aaec48076b969af1d7e1dacb48ee /utils.c
parent86a9f3172f6a6ca13348520706ca5a14f4cfb822 (diff)
downloadpuppeteer-4f5035ffa4e67beba5489cf8a23f02c872595ed2.tar.gz
puppeteer-4f5035ffa4e67beba5489cf8a23f02c872595ed2.tar.bz2
puppeteer-4f5035ffa4e67beba5489cf8a23f02c872595ed2.zip
started work on zooming and a textual hud.
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 4f75298..4813da5 100644
--- a/utils.c
+++ b/utils.c
@@ -2,6 +2,12 @@
#include <libc.h>
#include <draw.h>
+int
+clamp(int n, int min, int max)
+{
+ return n < min? min: n > max? max: n;
+}
+
double
fclamp(double n, double min, double max)
{