1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Switch MeshUpdateQueue to better data structure

This commit is contained in:
sfan5 2022-07-31 23:16:40 +02:00
parent 4c1ef1b72b
commit f22d40975e
2 changed files with 8 additions and 8 deletions

View file

@ -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"
@ -81,8 +83,8 @@ 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;