mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
GenElementManager: Pass opaque handles to Lua and rename to ObjDefManager
Add core.clear_registered_schematics() and refactor schematics somewhat
This commit is contained in:
parent
6a48844eba
commit
ed10005d38
16 changed files with 363 additions and 203 deletions
|
@ -183,7 +183,6 @@ u64 murmur_hash_64_ua(const void *key, int len, unsigned int seed)
|
|||
return h;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
blockpos: position of block in block coordinates
|
||||
camera_pos: position of camera in nodes
|
||||
|
|
|
@ -249,6 +249,28 @@ int myrand_range(int min, int max);
|
|||
Miscellaneous functions
|
||||
*/
|
||||
|
||||
inline u32 get_bits(u32 x, u32 pos, u32 len)
|
||||
{
|
||||
u32 mask = (1 << len) - 1;
|
||||
return (x >> pos) & mask;
|
||||
}
|
||||
|
||||
inline void set_bits(u32 *x, u32 pos, u32 len, u32 val)
|
||||
{
|
||||
u32 mask = (1 << len) - 1;
|
||||
*x &= ~(mask << len);
|
||||
*x |= (val & mask) << pos;
|
||||
}
|
||||
|
||||
inline u32 calc_parity(u32 v)
|
||||
{
|
||||
v ^= v >> 16;
|
||||
v ^= v >> 8;
|
||||
v ^= v >> 4;
|
||||
v &= 0xf;
|
||||
return (0x6996 >> v) & 1;
|
||||
}
|
||||
|
||||
u64 murmur_hash_64_ua(const void *key, int len, unsigned int seed);
|
||||
|
||||
bool isBlockInSight(v3s16 blockpos_b, v3f camera_pos, v3f camera_dir,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue