1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Add a bit of debug code around MapBlock refcounting

This commit is contained in:
sfan5 2025-07-24 14:18:38 +02:00
parent 39417cf7a7
commit 0c12c1f400
6 changed files with 74 additions and 31 deletions

View file

@ -187,26 +187,28 @@ public:
//// Position stuff
////
/// @return map position of block
inline v3s16 getPos()
{
return m_pos;
}
/// @return in-world position of the block (== pos * MAP_BLOCKSIZE)
inline v3s16 getPosRelative()
{
return m_pos_relative;
}
inline core::aabbox3d<s16> getBox() {
/// @return in-world box of the block
inline core::aabbox3d<s16> getBox()
{
return getBox(getPosRelative());
}
static inline core::aabbox3d<s16> getBox(const v3s16 &pos_relative)
static inline core::aabbox3d<s16> getBox(v3s16 pos_relative)
{
return core::aabbox3d<s16>(pos_relative,
pos_relative
+ v3s16(MAP_BLOCKSIZE, MAP_BLOCKSIZE, MAP_BLOCKSIZE)
- v3s16(1,1,1));
pos_relative + v3s16(MAP_BLOCKSIZE - 1));
}
////
@ -360,7 +362,7 @@ public:
}
////
//// Reference counting (see m_refcount)
//// Reference counting (different purposes on client vs. server)
////
inline void refGrab()
@ -470,10 +472,6 @@ private:
*/
v3s16 m_pos_relative;
/*
Reference count; currently used for determining if this block is in
the list of blocks to be drawn.
*/
short m_refcount = 0;
/*