build: move map & rng logic to their own libraries

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1802469f3baff4576f61accfb5a197d86a6a6964
This commit is contained in:
raf 2026-04-10 15:17:39 +03:00
commit 26aa295f82
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
17 changed files with 136 additions and 93 deletions

13
libs/map/utils.c Normal file
View 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;
}