mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Decoration: Add Schematic decoration type
This commit is contained in:
@@ -140,6 +140,22 @@ inline v3s16 arealim(v3s16 p, s16 d)
|
||||
return p;
|
||||
}
|
||||
|
||||
// The naive swap performs better than the xor version
|
||||
#define SWAP(t, x, y) do { \
|
||||
t temp = x; \
|
||||
x = y; \
|
||||
y = temp; \
|
||||
} while (0)
|
||||
|
||||
inline void sortBoxVerticies(v3s16 &p1, v3s16 &p2) {
|
||||
if (p1.X > p2.X)
|
||||
SWAP(s16, p1.X, p2.X);
|
||||
if (p1.Y > p2.Y)
|
||||
SWAP(s16, p1.Y, p2.Y);
|
||||
if (p1.Z > p2.Z)
|
||||
SWAP(s16, p1.Z, p2.Z);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
See test.cpp for example cases.
|
||||
|
Reference in New Issue
Block a user