diff options
author | number Zero <silverunicorn2011@yandex.ru> | 2017-02-23 16:04:39 +0300 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-03-11 02:15:21 +0000 |
commit | 25a24c0cdf1467df51c41d0b24e2ab6318ba1850 (patch) | |
tree | 08e67a1a815595a951426b7c2220b50e3afb197c /src/util | |
parent | ab371cc93491baf0973ecc94b96c3a1fdb4abfd5 (diff) | |
download | minetest-25a24c0cdf1467df51c41d0b24e2ab6318ba1850.tar.gz minetest-25a24c0cdf1467df51c41d0b24e2ab6318ba1850.tar.bz2 minetest-25a24c0cdf1467df51c41d0b24e2ab6318ba1850.zip |
Minimap: Optimise
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/numeric.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/numeric.h b/src/util/numeric.h index 4cdc254c3..760657171 100644 --- a/src/util/numeric.h +++ b/src/util/numeric.h @@ -149,6 +149,16 @@ inline void sortBoxVerticies(v3s16 &p1, v3s16 &p2) { SWAP(s16, p1.Z, p2.Z); } +inline v3s16 componentwise_min(const v3s16 &a, const v3s16 &b) +{ + return v3s16(MYMIN(a.X, b.X), MYMIN(a.Y, b.Y), MYMIN(a.Z, b.Z)); +} + +inline v3s16 componentwise_max(const v3s16 &a, const v3s16 &b) +{ + return v3s16(MYMAX(a.X, b.X), MYMAX(a.Y, b.Y), MYMAX(a.Z, b.Z)); +} + /** Returns \p f wrapped to the range [-360, 360] * |