Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
MeshUpdateQueue Class Reference

#include <mesh_generator_thread.h>

+ Collaboration diagram for MeshUpdateQueue:

Public Member Functions

 MeshUpdateQueue (Client *client)
 
 ~MeshUpdateQueue ()
 
bool addBlock (Map *map, v3s16 p, bool ack_block_to_server, bool urgent)
 
QueuedMeshUpdatepop ()
 
void done (v3s16 pos)
 
u32 size ()
 

Private Types

enum  UpdateMode { FORCE_UPDATE , SKIP_UPDATE_IF_ALREADY_CACHED }
 

Private Member Functions

void fillDataFromMapBlocks (QueuedMeshUpdate *q)
 

Private Attributes

Clientm_client
 
std::vector< QueuedMeshUpdate * > m_queue
 
std::unordered_set< v3s16m_urgents
 
std::unordered_set< v3s16m_inflight_blocks
 
std::mutex m_mutex
 
bool m_cache_smooth_lighting
 

Member Enumeration Documentation

◆ UpdateMode

Enumerator
FORCE_UPDATE 
SKIP_UPDATE_IF_ALREADY_CACHED 

Constructor & Destructor Documentation

◆ MeshUpdateQueue()

MeshUpdateQueue::MeshUpdateQueue ( Client * client)

References g_settings, Settings::getBool(), and m_cache_smooth_lighting.

+ Here is the call graph for this function:

◆ ~MeshUpdateQueue()

MeshUpdateQueue::~MeshUpdateQueue ( )

References m_mutex, and m_queue.

Member Function Documentation

◆ addBlock()

bool MeshUpdateQueue::addBlock ( Map * map,
v3s16 p,
bool ack_block_to_server,
bool urgent )

References QueuedMeshUpdate::ack_list, MeshGrid::cell_size, QueuedMeshUpdate::crack_level, QueuedMeshUpdate::crack_pos, Map::getBlockNoCreateNoEx(), Client::getCrackLevel(), Client::getCrackPos(), Client::getMeshGrid(), MeshGrid::getMeshPos(), m_client, m_mutex, m_queue, m_urgents, QueuedMeshUpdate::map_blocks, p(), QueuedMeshUpdate::p, MapBlock::refGrab(), and QueuedMeshUpdate::urgent.

Referenced by MeshUpdateManager::updateBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ done()

void MeshUpdateQueue::done ( v3s16 pos)

References m_inflight_blocks, and m_mutex.

Referenced by MeshUpdateWorkerThread::doUpdate().

+ Here is the caller graph for this function:

◆ fillDataFromMapBlocks()

void MeshUpdateQueue::fillDataFromMapBlocks ( QueuedMeshUpdate * q)
private

References block_placeholder, QueuedMeshUpdate::crack_level, QueuedMeshUpdate::crack_pos, BlockPlaceholder::data, QueuedMeshUpdate::data, MeshMakeData::fillBlockData(), MeshMakeData::fillBlockDataBegin(), MapBlock::getData(), Client::getMeshGrid(), m_cache_smooth_lighting, m_client, QueuedMeshUpdate::map_blocks, MAP_BLOCKSIZE, IGameDef::ndef(), QueuedMeshUpdate::p, MeshMakeData::setCrack(), and MeshMakeData::setSmoothLighting().

Referenced by pop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pop()

QueuedMeshUpdate * MeshUpdateQueue::pop ( )

References fillDataFromMapBlocks(), m_inflight_blocks, m_mutex, m_queue, m_urgents, and QueuedMeshUpdate::p.

Referenced by MeshUpdateWorkerThread::doUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

u32 MeshUpdateQueue::size ( )
inline

References m_mutex, and m_queue.

Member Data Documentation

◆ m_cache_smooth_lighting

bool MeshUpdateQueue::m_cache_smooth_lighting
private

◆ m_client

Client* MeshUpdateQueue::m_client
private

Referenced by addBlock(), and fillDataFromMapBlocks().

◆ m_inflight_blocks

std::unordered_set<v3s16> MeshUpdateQueue::m_inflight_blocks
private

Referenced by done(), and pop().

◆ m_mutex

std::mutex MeshUpdateQueue::m_mutex
private

◆ m_queue

std::vector<QueuedMeshUpdate *> MeshUpdateQueue::m_queue
private

Referenced by ~MeshUpdateQueue(), addBlock(), pop(), and size().

◆ m_urgents

std::unordered_set<v3s16> MeshUpdateQueue::m_urgents
private

Referenced by addBlock(), and pop().


The documentation for this class was generated from the following files: