diff options
author | number Zero <silverunicorn2011@yandex.ru> | 2017-02-18 21:53:05 +0300 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-03-26 05:50:59 +0100 |
commit | 4d5177ff708c7e696eead18200e240047ff520fe (patch) | |
tree | ea77f5af4479fa6a6eb39f9cc87aa379a86f4aa1 /src/client.cpp | |
parent | 22567d107fffe7a6833b96cc99d531e5303b47dd (diff) | |
download | minetest-4d5177ff708c7e696eead18200e240047ff520fe.tar.gz minetest-4d5177ff708c7e696eead18200e240047ff520fe.tar.bz2 minetest-4d5177ff708c7e696eead18200e240047ff520fe.zip |
Add mesh generation delay
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client.cpp b/src/client.cpp index 0c4819bc5..8bbaa83bd 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -157,6 +157,12 @@ QueuedMeshUpdate *MeshUpdateQueue::pop() MeshUpdateThread */ +MeshUpdateThread::MeshUpdateThread() : UpdateThread("Mesh") +{ + m_generation_interval = g_settings->getU16("mesh_generation_interval"); + m_generation_interval = rangelim(m_generation_interval, 0, 50); +} + void MeshUpdateThread::enqueueUpdate(v3s16 p, MeshMakeData *data, bool ack_block_to_server, bool urgent) { @@ -168,7 +174,8 @@ void MeshUpdateThread::doUpdate() { QueuedMeshUpdate *q; while ((q = m_queue_in.pop())) { - + if (m_generation_interval) + sleep_ms(m_generation_interval); ScopeProfiler sp(g_profiler, "Client: Mesh making"); MapBlockMesh *mesh_new = new MapBlockMesh(q->data, m_camera_offset); |