mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Reorganize ClientMap rendering code for a bit more performance
- Don't select blocks for drawing in every frame - Sort meshbuffers by material before drawing
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user