mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Reduce size of some MapBlock members
Also adds assertions to catch refcounting errors (on a debug build).
This commit is contained in:
parent
777dca7043
commit
9408a1a025
@ -379,15 +379,17 @@ public:
|
||||
|
||||
inline void refGrab()
|
||||
{
|
||||
assert(m_refcount < SHRT_MAX);
|
||||
m_refcount++;
|
||||
}
|
||||
|
||||
inline void refDrop()
|
||||
{
|
||||
assert(m_refcount > 0);
|
||||
m_refcount--;
|
||||
}
|
||||
|
||||
inline int refGet()
|
||||
inline short refGet()
|
||||
{
|
||||
return m_refcount;
|
||||
}
|
||||
@ -500,7 +502,7 @@ private:
|
||||
block has been modified from the one on disk.
|
||||
- On the client, this is used for nothing.
|
||||
*/
|
||||
u32 m_modified = MOD_STATE_WRITE_NEEDED;
|
||||
u16 m_modified = MOD_STATE_WRITE_NEEDED;
|
||||
u32 m_modified_reason = MOD_REASON_INITIAL;
|
||||
|
||||
/*
|
||||
@ -550,7 +552,7 @@ private:
|
||||
Reference count; currently used for determining if this block is in
|
||||
the list of blocks to be drawn.
|
||||
*/
|
||||
int m_refcount = 0;
|
||||
short m_refcount = 0;
|
||||
|
||||
NodeTimerList m_node_timers;
|
||||
};
|
||||
|
@ -19,7 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
|
||||
#pragma once
|
||||
|
||||
enum ModifiedState
|
||||
#include "irrlichttypes.h"
|
||||
|
||||
enum ModifiedState : u16
|
||||
{
|
||||
// Has not been modified.
|
||||
MOD_STATE_CLEAN = 0,
|
||||
|
Loading…
Reference in New Issue
Block a user