From ee2d9d973a0397ce244f05d49083250956578780 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 4 Sep 2012 09:48:26 +0300 Subject: Reorganize ClientMap rendering code for a bit more performance - Don't select blocks for drawing in every frame - Sort meshbuffers by material before drawing --- src/mapblock.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/mapblock.h') diff --git a/src/mapblock.h b/src/mapblock.h index 7f901e5d3..d56d93dda 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -430,6 +430,22 @@ public: { return m_usage_timer; } + + /* + See m_refcount + */ + void refGrab() + { + m_refcount++; + } + void refDrop() + { + m_refcount--; + } + int refGet() + { + return m_refcount; + } /* Node Timers @@ -566,6 +582,12 @@ private: Map will unload the block when this reaches a timeout. */ float m_usage_timer; + + /* + Reference count; currently used for determining if this block is in + the list of blocks to be drawn. + */ + int m_refcount; }; inline bool blockpos_over_limit(v3s16 p) -- cgit v1.2.3