1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +00:00

clamp function

This commit is contained in:
Zeno Rogue 2024-05-27 13:52:45 +02:00
parent 5c03f9c7fe
commit 0e09775669

View File

@ -64,6 +64,12 @@ EX ld lerp(ld a0, ld a1, ld x) {
return a0 + (a1-a0) * x;
}
EX ld clamp(ld a, ld v0, ld v1) {
if(a < v0) return v0;
if(a > v1) return v1;
return a;
}
EX cld lerp(cld a0, cld a1, ld x) {
return a0 + (a1-a0) * x;
}