initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ie3b66d17f6f660c9b9a719210bd86f9f6a6a6964
This commit is contained in:
commit
b381e2efbd
29 changed files with 1633 additions and 0 deletions
13
src/utils.c
Normal file
13
src/utils.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include "utils.h"
|
||||
|
||||
int clamp(int value, int min, int max) {
|
||||
if (value < min)
|
||||
return min;
|
||||
if (value > max)
|
||||
return max;
|
||||
return value;
|
||||
}
|
||||
|
||||
int in_bounds(int x, int y, int width, int height) {
|
||||
return x >= 0 && x < width && y >= 0 && y < height;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue