diff options
Diffstat (limited to 'src/client/mesh_generator_thread.h')
-rw-r--r-- | src/client/mesh_generator_thread.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/mesh_generator_thread.h b/src/client/mesh_generator_thread.h index 1b734bc06..09400196d 100644 --- a/src/client/mesh_generator_thread.h +++ b/src/client/mesh_generator_thread.h @@ -21,6 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <ctime> #include <mutex> +#include <unordered_map> +#include <unordered_set> #include "mapblock_mesh.h" #include "threading/mutex_auto_lock.h" #include "util/thread.h" @@ -43,6 +45,7 @@ struct QueuedMeshUpdate int crack_level = -1; v3s16 crack_pos; MeshMakeData *data = nullptr; // This is generated in MeshUpdateQueue::pop() + bool urgent = false; QueuedMeshUpdate() = default; ~QueuedMeshUpdate(); @@ -81,8 +84,9 @@ public: private: Client *m_client; std::vector<QueuedMeshUpdate *> m_queue; - std::set<v3s16> m_urgents; - std::map<v3s16, CachedMapBlockData *> m_cache; + std::unordered_set<v3s16> m_urgents; + std::unordered_map<v3s16, CachedMapBlockData *> m_cache; + u64 m_next_cache_cleanup; // milliseconds std::mutex m_mutex; // TODO: Add callback to update these when g_settings changes @@ -102,6 +106,7 @@ struct MeshUpdateResult v3s16 p = v3s16(-1338, -1338, -1338); MapBlockMesh *mesh = nullptr; bool ack_block_to_server = false; + bool urgent = false; MeshUpdateResult() = default; }; |