#include <mesh_generator_thread.h>
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 |
|
private |
| MeshUpdateManager::MeshUpdateManager | ( | Client * | client | ) |
References g_settings, Thread::getNumberOfProcessors(), Settings::getS32(), infostream, m_queue_in, m_workers, and rangelim().
| void MeshUpdateManager::clearAllQueues | ( | ) |
References MeshUpdateQueue::clear(), m_queue_in, m_queue_out, and m_queue_out_urgent.
Referenced by Client::~Client().
|
private |
References m_workers.
Referenced by forceRegenerate(), and updateBlock().
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.
| pp | block positions |
References MeshUpdateQueue::addBlock(), deferUpdate(), m_epoch, m_queue_in, MeshUpdateQueue::setEpoch(), and verbosestream.
Referenced by Client::updateStaticLighting().
| bool MeshUpdateManager::getNextResult | ( | MeshUpdateResult & | r | ) |
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().
| bool MeshUpdateManager::isRunning | ( | ) |
References m_workers.
Referenced by Client::handleCommand_AnnounceMedia(), Client::handleCommand_ItemDef(), Client::handleCommand_Media(), Client::handleCommand_NodeDef(), and Client::isShutdown().
| void MeshUpdateManager::putResult | ( | MeshUpdateResult && | r | ) |
References m_queue_out, m_queue_out_urgent, and MutexedQueue< T >::push_back().
Referenced by MeshUpdateWorkerThread::doUpdate().
| void MeshUpdateManager::start | ( | ) |
References m_workers.
Referenced by Client::afterContentReceived().
| void MeshUpdateManager::stop | ( | ) |
References m_workers.
Referenced by Client::~Client(), and Client::Stop().
| 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().
| void MeshUpdateManager::wait | ( | ) |
|
private |
Referenced by forceRegenerate(), and getNextResult().
|
private |
Referenced by MeshUpdateManager(), clearAllQueues(), forceRegenerate(), getNextResult(), and updateBlock().
|
private |
Referenced by clearAllQueues(), getNextResult(), and putResult().
|
private |
Referenced by clearAllQueues(), getNextResult(), and putResult().
|
private |
Referenced by MeshUpdateManager(), deferUpdate(), isRunning(), start(), stop(), and wait().