Luanti 5.19.0-dev
Loading...
Searching...
No Matches
MeshUpdateManager Class Reference

#include <mesh_generator_thread.h>

Collaboration diagram for MeshUpdateManager:

Public Member Functions

 MeshUpdateManager (Client *client)
void updateBlock (Map *map, v3s16 p, bool urgent, bool update_neighbors=false)
void putResult (MeshUpdateResult &&r)
bool getNextResult (MeshUpdateResult &r)
void forceRegenerate (Map *map, const std::vector< v3s16 > &pp)
 Forces all in-progress meshes to be re-generated and adds all passed positions to the queue.
void clearAllQueues ()
void start ()
void stop ()
void wait ()
bool isRunning ()

Private Types

typedef MutexedQueue< MeshUpdateResult > ResultQueue

Private Member Functions

void deferUpdate ()

Private Attributes

u16 m_epoch = 0
MeshUpdateQueue m_queue_in
ResultQueue m_queue_out
ResultQueue m_queue_out_urgent
std::vector< std::unique_ptr< MeshUpdateWorkerThread > > m_workers

Member Typedef Documentation

◆ ResultQueue

Constructor & Destructor Documentation

◆ MeshUpdateManager()

MeshUpdateManager::MeshUpdateManager ( Client * client)

References g_settings, Thread::getNumberOfProcessors(), Settings::getS32(), infostream, m_queue_in, m_workers, and rangelim().

Here is the call graph for this function:

Member Function Documentation

◆ clearAllQueues()

void MeshUpdateManager::clearAllQueues ( )

References MeshUpdateQueue::clear(), m_queue_in, m_queue_out, and m_queue_out_urgent.

Referenced by Client::~Client().

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

◆ deferUpdate()

void MeshUpdateManager::deferUpdate ( )
private

References m_workers.

Referenced by forceRegenerate(), and updateBlock().

Here is the caller graph for this function:

◆ forceRegenerate()

void MeshUpdateManager::forceRegenerate ( Map * map,
const std::vector< v3s16 > & pp )

Forces all in-progress meshes to be re-generated and adds all passed positions to the queue.

This is used after parameters the meshgen depends on have changed.

Parameters
ppblock positions

References MeshUpdateQueue::addBlock(), deferUpdate(), m_epoch, m_queue_in, MeshUpdateQueue::setEpoch(), and verbosestream.

Referenced by Client::updateStaticLighting().

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

◆ getNextResult()

bool MeshUpdateManager::getNextResult ( MeshUpdateResult & r)
Note
caller needs to refDrop() the affected map_blocks

References MeshUpdateResult::MeshUpdateResult(), MutexedQueue< T >::empty(), MeshUpdateResult::epoch, getNextResult(), m_epoch, m_queue_in, m_queue_out, m_queue_out_urgent, MeshUpdateResult::p, MutexedQueue< T >::pop_frontNoEx(), MeshUpdateQueue::reAddBlock(), and verbosestream.

Referenced by getNextResult(), and Client::step().

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

◆ isRunning()

bool MeshUpdateManager::isRunning ( )

References m_workers.

Referenced by Client::handleCommand_AnnounceMedia(), Client::handleCommand_ItemDef(), Client::handleCommand_Media(), Client::handleCommand_NodeDef(), and Client::isShutdown().

Here is the caller graph for this function:

◆ putResult()

void MeshUpdateManager::putResult ( MeshUpdateResult && r)

References m_queue_out, m_queue_out_urgent, and MutexedQueue< T >::push_back().

Referenced by MeshUpdateWorkerThread::doUpdate().

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

◆ start()

void MeshUpdateManager::start ( )

References m_workers.

Referenced by Client::afterContentReceived().

Here is the caller graph for this function:

◆ stop()

void MeshUpdateManager::stop ( )

References m_workers.

Referenced by Client::~Client(), and Client::Stop().

Here is the caller graph for this function:

◆ updateBlock()

void MeshUpdateManager::updateBlock ( Map * map,
v3s16 p,
bool urgent,
bool update_neighbors = false )

References MeshUpdateQueue::addBlock(), deferUpdate(), g_26dirs, g_6dirs, g_settings, Settings::getBool(), Settings::getFlag(), m_queue_in, and warningstream.

Referenced by Client::addUpdateMeshTask(), Client::addUpdateMeshTaskForNode(), and Client::addUpdateMeshTaskWithEdge().

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

◆ wait()

void MeshUpdateManager::wait ( )

References m_workers.

Referenced by Client::~Client().

Here is the caller graph for this function:

Member Data Documentation

◆ m_epoch

u16 MeshUpdateManager::m_epoch = 0
private

Referenced by forceRegenerate(), and getNextResult().

◆ m_queue_in

MeshUpdateQueue MeshUpdateManager::m_queue_in
private

◆ m_queue_out

ResultQueue MeshUpdateManager::m_queue_out
private

◆ m_queue_out_urgent

ResultQueue MeshUpdateManager::m_queue_out_urgent
private

◆ m_workers

std::vector<std::unique_ptr<MeshUpdateWorkerThread> > MeshUpdateManager::m_workers
private

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