summaryrefslogtreecommitdiff
path: root/src/mapblock.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-09-04 09:48:26 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-09-04 22:41:03 +0300
commitee2d9d973a0397ce244f05d49083250956578780 (patch)
treed3626b0eb5f995ede95f929f721d9cd52a7c5072 /src/mapblock.h
parent0e6f7a21c60d162b3b7134882dc22dbd8acd014f (diff)
downloadminetest-ee2d9d973a0397ce244f05d49083250956578780.tar.gz
minetest-ee2d9d973a0397ce244f05d49083250956578780.tar.bz2
minetest-ee2d9d973a0397ce244f05d49083250956578780.zip
Reorganize ClientMap rendering code for a bit more performance
- Don't select blocks for drawing in every frame - Sort meshbuffers by material before drawing
Diffstat (limited to 'src/mapblock.h')
-rw-r--r--src/mapblock.h22
1 files changed, 22 insertions, 0 deletions
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)