1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Move f1000 sanitizing to the places that still use this type

This commit is contained in:
sfan5 2022-06-08 19:33:46 +02:00
parent b204655081
commit 137eef6590
6 changed files with 8 additions and 17 deletions

View file

@ -439,16 +439,14 @@ MAKE_STREAM_WRITE_FXN(video::SColor, ARGB8, 4);
//// More serialization stuff
////
inline void clampToF1000(float &v)
inline float clampToF1000(float v)
{
v = core::clamp(v, F1000_MIN, F1000_MAX);
return core::clamp(v, F1000_MIN, F1000_MAX);
}
inline void clampToF1000(v3f &v)
inline v3f clampToF1000(v3f v)
{
clampToF1000(v.X);
clampToF1000(v.Y);
clampToF1000(v.Z);
return {clampToF1000(v.X), clampToF1000(v.Y), clampToF1000(v.Z)};
}
// Creates a string with the length as the first two bytes