mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Refactor decoration-related code
Split up ModApiMapgen::l_register_decoration() Define and make use of CONTAINS() and ARRLEN() macros
This commit is contained in:
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include "../irr_v3d.h"
|
||||
#include "../irr_aabb3d.h"
|
||||
#include <list>
|
||||
#include <algorithm>
|
||||
|
||||
// Calculate the borders of a "d-radius" cube
|
||||
void getFacePositions(std::list<v3s16> &list, u16 d);
|
||||
@@ -139,6 +140,9 @@ inline v3s16 arealim(v3s16 p, s16 d)
|
||||
return p;
|
||||
}
|
||||
|
||||
#define ARRLEN(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#define CONTAINS(c, v) (std::find((c).begin(), (c).end(), (v)) != (c).end())
|
||||
|
||||
// The naive swap performs better than the xor version
|
||||
#define SWAP(t, x, y) do { \
|
||||
t temp = x; \
|
||||
|
Reference in New Issue
Block a user