X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmesh_generator_thread.h;h=6edb6906d9712c92f4326fce70474ebaf38702e0;hb=001de6ffbac83bcd41ecda075d79d265a69c7d42;hp=e74861862447b6b72d0b6742613101b01c8d01a4;hpb=04cc9de8f2fbcb11f133c88f02fc11504b3ea6f3;p=minetest.git diff --git a/src/mesh_generator_thread.h b/src/mesh_generator_thread.h index e74861862..6edb6906d 100644 --- a/src/mesh_generator_thread.h +++ b/src/mesh_generator_thread.h @@ -53,10 +53,12 @@ struct QueuedMeshUpdate */ class MeshUpdateQueue { - enum UpdateMode { + enum UpdateMode + { FORCE_UPDATE, SKIP_UPDATE_IF_ALREADY_CACHED, }; + public: MeshUpdateQueue(Client *client); @@ -68,7 +70,7 @@ class MeshUpdateQueue // Returned pointer must be deleted // Returns NULL if queue is empty - QueuedMeshUpdate * pop(); + QueuedMeshUpdate *pop(); u32 size() { @@ -78,9 +80,9 @@ class MeshUpdateQueue private: Client *m_client; - std::vector m_queue; + std::vector m_queue; std::set m_urgents; - std::map m_cache; + std::map m_cache; Mutex m_mutex; // TODO: Add callback to update these when g_settings changes @@ -89,9 +91,9 @@ class MeshUpdateQueue bool m_cache_smooth_lighting; int m_meshgen_block_cache_size; - CachedMapBlockData* cacheBlock(Map *map, v3s16 p, UpdateMode mode, - size_t *cache_hit_counter=NULL); - CachedMapBlockData* getCachedBlock(const v3s16 &p); + CachedMapBlockData *cacheBlock(Map *map, v3s16 p, UpdateMode mode, + size_t *cache_hit_counter = NULL); + CachedMapBlockData *getCachedBlock(const v3s16 &p); void fillDataFromMapBlockCache(QueuedMeshUpdate *q); void cleanupCache(); }; @@ -102,10 +104,8 @@ struct MeshUpdateResult MapBlockMesh *mesh; bool ack_block_to_server; - MeshUpdateResult(): - p(-1338,-1338,-1338), - mesh(NULL), - ack_block_to_server(false) + MeshUpdateResult() + : p(-1338, -1338, -1338), mesh(NULL), ack_block_to_server(false) { } };