1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Weather support

This commit is contained in:
proller 2013-07-27 22:34:30 +04:00
parent e65d8ad655
commit 3aedfac968
23 changed files with 552 additions and 91 deletions

View file

@ -349,5 +349,12 @@ inline void paging(u32 length, u32 page, u32 pagecount, u32 &minindex, u32 &maxi
}
}
inline float cycle_shift(float value, float by = 0, float max = 1)
{
if (value + by < 0) return max + by + value;
if (value + by > max) return value + by - max;
return value + by;
}
#endif