mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Remove mapblock cache for mesh generation. (#13124)
Reduces memory consumption and improves performance
This commit is contained in:
parent
d69cb4fb5d
commit
139db66901
4 changed files with 74 additions and 172 deletions
|
@ -339,8 +339,12 @@ Client::~Client()
|
|||
m_mesh_update_manager.wait();
|
||||
|
||||
MeshUpdateResult r;
|
||||
while (m_mesh_update_manager.getNextResult(r))
|
||||
while (m_mesh_update_manager.getNextResult(r)) {
|
||||
for (auto block : r.map_blocks)
|
||||
if (block)
|
||||
block->refDrop();
|
||||
delete r.mesh;
|
||||
}
|
||||
|
||||
delete m_inventory_from_server;
|
||||
|
||||
|
@ -595,6 +599,10 @@ void Client::step(float dtime)
|
|||
|
||||
blocks_to_ack.emplace_back(r.p);
|
||||
}
|
||||
|
||||
for (auto block : r.map_blocks)
|
||||
if (block)
|
||||
block->refDrop();
|
||||
}
|
||||
if (blocks_to_ack.size() > 0) {
|
||||
// Acknowledge block(s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue