mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00: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:
parent
0e6f7a21c6
commit
ee2d9d973a
6 changed files with 281 additions and 101 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue