Luanti 5.19.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 urgent, bool from_neighbor)
 Caches the block at p and its neighbors (if needed) and queues a mesh update for the block p.
void reAddBlock (MeshUpdateResult &r)
 Re-queues a block that was already finished.
void setEpoch (u16 epoch)
QueuedMeshUpdate * pop ()
void done (v3s16 pos)
size_t size ()
void clear ()

Private Member Functions

void fillDataFromMapBlocks (QueuedMeshUpdate *q)

Private Attributes

Client * m_client
std::vector< QueuedMeshUpdate * > m_queue
std::unordered_set< v3s16 > m_urgents
std::unordered_set< v3s16 > m_inflight_blocks
u16 m_epoch = 0
std::mutex m_mutex
bool m_cache_smooth_lighting
bool m_cache_enable_water_reflections
bool m_cache_enable_waving_water

Constructor & Destructor Documentation

◆ MeshUpdateQueue()

MeshUpdateQueue::MeshUpdateQueue ( Client * client)

References g_settings, Settings::getBool(), m_cache_enable_water_reflections, m_cache_enable_waving_water, m_cache_smooth_lighting, and m_client.

Here is the call graph for this function:

◆ ~MeshUpdateQueue()

MeshUpdateQueue::~MeshUpdateQueue ( )

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ addBlock()

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

Caches the block at p and its neighbors (if needed) and queues a mesh update for the block p.

Parameters
mapMap
pblock position
urgentHigh-priority?
from_neighborwas this update only necessary due to a neighbor change?

References QueuedMeshUpdate::QueuedMeshUpdate(), Profiler::add(), MeshGrid::cell_size, g_profiler, Map::getBlockNoCreateNoEx(), Client::getCrackLevel(), Client::getCrackPos(), Client::getMeshGrid(), MeshGrid::getMeshPos(), m_client, m_mutex, m_queue, and m_urgents.

Referenced by MeshUpdateManager::forceRegenerate(), and MeshUpdateManager::updateBlock().

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

◆ clear()

void MeshUpdateQueue::clear ( )

References m_inflight_blocks, m_mutex, m_queue, and m_urgents.

Referenced by ~MeshUpdateQueue(), and MeshUpdateManager::clearAllQueues().

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()

◆ pop()

QueuedMeshUpdate * MeshUpdateQueue::pop ( )

References QueuedMeshUpdate::epoch, fillDataFromMapBlocks(), m_epoch, 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:

◆ reAddBlock()

void MeshUpdateQueue::reAddBlock ( MeshUpdateResult & r)

Re-queues a block that was already finished.

References QueuedMeshUpdate::QueuedMeshUpdate(), MeshUpdateResult::dropBlocks(), Client::getCrackLevel(), Client::getCrackPos(), Client::getMeshGrid(), MeshGrid::getMeshPos(), m_client, m_mutex, m_queue, m_urgents, MeshUpdateResult::map_blocks, MeshUpdateResult::p, and MeshUpdateResult::urgent.

Referenced by MeshUpdateManager::getNextResult().

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

◆ setEpoch()

void MeshUpdateQueue::setEpoch ( u16 epoch)
inline

References m_epoch, and m_mutex.

Referenced by MeshUpdateManager::forceRegenerate().

Here is the caller graph for this function:

◆ size()

size_t MeshUpdateQueue::size ( )
inline

References m_mutex, and m_queue.

Member Data Documentation

◆ m_cache_enable_water_reflections

bool MeshUpdateQueue::m_cache_enable_water_reflections
private

◆ m_cache_enable_waving_water

bool MeshUpdateQueue::m_cache_enable_waving_water
private

◆ m_cache_smooth_lighting

bool MeshUpdateQueue::m_cache_smooth_lighting
private

◆ m_client

Client* MeshUpdateQueue::m_client
private

◆ m_epoch

u16 MeshUpdateQueue::m_epoch = 0
private

Referenced by pop(), and setEpoch().

◆ m_inflight_blocks

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

Referenced by clear(), done(), and pop().

◆ m_mutex

std::mutex MeshUpdateQueue::m_mutex
private

◆ m_queue

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

Referenced by addBlock(), clear(), pop(), reAddBlock(), and size().

◆ m_urgents

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

Referenced by addBlock(), clear(), pop(), and reAddBlock().


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