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

Decoration: Add Schematic decoration type

This commit is contained in:
kwolekr 2013-06-22 00:29:44 -04:00
parent b1a74df26d
commit c1b829077a
8 changed files with 589 additions and 22 deletions

View file

@ -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.