#include <minimap.h>
Public Member Functions | |
MinimapUpdateThread () | |
virtual | ~MinimapUpdateThread () |
void | getMap (v3s16 pos, s16 size, s16 height) |
void | enqueueBlock (v3s16 pos, MinimapMapblock *data) |
bool | pushBlockUpdate (v3s16 pos, MinimapMapblock *data) |
bool | popBlockUpdate (QueuedMinimapUpdate *update) |
Public Member Functions inherited from UpdateThread | |
UpdateThread (const std::string &name) | |
~UpdateThread ()=default | |
void | deferUpdate () |
void | stop () |
void * | run () |
Public Member Functions inherited from Thread | |
Thread (const std::string &name="") | |
virtual | ~Thread () |
bool | start () |
bool | stop () |
bool | wait () |
bool | isCurrentThread () |
bool | isRunning () |
bool | stopRequested () |
std::thread::id | getThreadId () |
bool | getReturnValue (void **ret) |
bool | bindToProcessor (unsigned int proc_number) |
bool | setPriority (int prio) |
Public Attributes | |
MinimapData * | data = nullptr |
Protected Member Functions | |
virtual void | doUpdate () |
Private Attributes | |
std::mutex | m_queue_mutex |
std::deque< QueuedMinimapUpdate > | m_update_queue |
std::map< v3s16, MinimapMapblock * > | m_blocks_cache |
Additional Inherited Members | |
Static Public Member Functions inherited from Thread | |
static Thread * | getCurrentThread () |
static void | setName (const std::string &name) |
static unsigned int | getNumberOfProcessors () |
Protected Attributes inherited from Thread | |
std::string | m_name |
|
inline |
|
virtual |
References m_blocks_cache, and m_update_queue.
|
protectedvirtual |
Implements UpdateThread.
References data, QueuedMinimapUpdate::data, getMap(), m_blocks_cache, MinimapData::map_invalidated, MinimapModeDef::map_size, MINIMAP_TYPE_RADAR, MINIMAP_TYPE_SURFACE, MinimapData::mode, popBlockUpdate(), MinimapData::pos, QueuedMinimapUpdate::pos, MinimapModeDef::scan_height, and MinimapModeDef::type.
void MinimapUpdateThread::enqueueBlock | ( | v3s16 | pos, |
MinimapMapblock * | data ) |
References data, UpdateThread::deferUpdate(), and pushBlockUpdate().
Referenced by Minimap::addBlock().
void MinimapUpdateThread::getMap | ( | v3s16 | pos, |
s16 | size, | ||
s16 | height ) |
References MinimapPixel::air_count, componentwise_max(), componentwise_min(), CONTENT_AIR, MinimapMapblock::data, data, getNodeBlockPos(), MinimapPixel::height, m_blocks_cache, MAP_BLOCKSIZE, MinimapData::minimap_scan, MinimapPixel::n, and MapNode::param0.
Referenced by doUpdate().
bool MinimapUpdateThread::popBlockUpdate | ( | QueuedMinimapUpdate * | update | ) |
References m_queue_mutex, and m_update_queue.
Referenced by doUpdate().
bool MinimapUpdateThread::pushBlockUpdate | ( | v3s16 | pos, |
MinimapMapblock * | data ) |
References data, QueuedMinimapUpdate::data, m_queue_mutex, m_update_queue, and QueuedMinimapUpdate::pos.
Referenced by enqueueBlock().
MinimapData* MinimapUpdateThread::data = nullptr |
Referenced by Minimap::Minimap(), doUpdate(), enqueueBlock(), getMap(), and pushBlockUpdate().
|
private |
Referenced by ~MinimapUpdateThread(), doUpdate(), and getMap().
|
private |
Referenced by popBlockUpdate(), and pushBlockUpdate().
|
private |
Referenced by ~MinimapUpdateThread(), popBlockUpdate(), and pushBlockUpdate().