Minetest  5.4.0
Minimap Class Reference

#include <minimap.h>

+ Collaboration diagram for Minimap:

Public Member Functions

 Minimap (Client *client)
 
 ~Minimap ()
 
void addBlock (v3s16 pos, MinimapMapblock *data)
 
v3f getYawVec ()
 
void setPos (v3s16 pos)
 
v3s16 getPos () const
 
void setAngle (f32 angle)
 
f32 getAngle () const
 
void toggleMinimapShape ()
 
void setMinimapShape (MinimapShape shape)
 
MinimapShape getMinimapShape ()
 
void clearModes ()
 
void addMode (MinimapModeDef mode)
 
void addMode (MinimapType type, u16 size=0, std::string label="", std::string texture="", u16 scale=1)
 
void setModeIndex (size_t index)
 
size_t getModeIndex () const
 
size_t getMaxModeIndex () const
 
void nextMode ()
 
MinimapModeDef getModeDef () const
 
video::ITexture * getMinimapTexture ()
 
void blitMinimapPixelsToImageRadar (video::IImage *map_image)
 
void blitMinimapPixelsToImageSurface (video::IImage *map_image, video::IImage *heightmap_image)
 
scene::SMeshBuffer * getMinimapMeshBuffer ()
 
MinimapMarkeraddMarker (scene::ISceneNode *parent_node)
 
void removeMarker (MinimapMarker **marker)
 
void updateActiveMarkers ()
 
void drawMinimap ()
 
void drawMinimap (core::rect< s32 > rect)
 

Public Attributes

video::IVideoDriver * driver
 
Clientclient
 
MinimapDatadata
 

Private Attributes

ITextureSourcem_tsrc
 
IShaderSourcem_shdrsrc
 
const NodeDefManagerm_ndef
 
MinimapUpdateThreadm_minimap_update_thread = nullptr
 
scene::SMeshBuffer * m_meshbuffer
 
bool m_enable_shaders
 
std::vector< MinimapModeDefm_modes
 
size_t m_current_mode_index
 
u16 m_surface_mode_scan_height
 
f32 m_angle
 
std::mutex m_mutex
 
std::list< MinimapMarker * > m_markers
 
std::list< v2fm_active_markers
 

Constructor & Destructor Documentation

◆ Minimap()

◆ ~Minimap()

Minimap::~Minimap ( )

Member Function Documentation

◆ addBlock()

void Minimap::addBlock ( v3s16  pos,
MinimapMapblock data 
)

References data, MinimapUpdateThread::enqueueBlock(), and m_minimap_update_thread.

Referenced by Client::step().

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

◆ addMarker()

MinimapMarker * Minimap::addMarker ( scene::ISceneNode *  parent_node)

References m_markers.

Referenced by GenericCAO::updateMarker().

+ Here is the caller graph for this function:

◆ addMode() [1/2]

void Minimap::addMode ( MinimapModeDef  mode)

References MinimapModeDef::label, m_modes, MinimapModeDef::map_size, MINIMAP_TYPE_OFF, MINIMAP_TYPE_RADAR, MINIMAP_TYPE_SURFACE, MINIMAP_TYPE_TEXTURE, porting::mt_snprintf(), MinimapModeDef::scale, MinimapModeDef::texture, and MinimapModeDef::type.

Referenced by Minimap(), addMode(), and Client::handleCommand_MinimapModes().

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

◆ addMode() [2/2]

void Minimap::addMode ( MinimapType  type,
u16  size = 0,
std::string  label = "",
std::string  texture = "",
u16  scale = 1 
)

References addMode(), MinimapModeDef::label, m_surface_mode_scan_height, MinimapModeDef::map_size, MINIMAP_TYPE_RADAR, MINIMAP_TYPE_SURFACE, MinimapModeDef::scale, MinimapModeDef::scan_height, MinimapModeDef::texture, and MinimapModeDef::type.

+ Here is the call graph for this function:

◆ blitMinimapPixelsToImageRadar()

void Minimap::blitMinimapPixelsToImageRadar ( video::IImage *  map_image)

References MinimapPixel::air_count, data, MinimapModeDef::map_size, MinimapData::minimap_scan, and MinimapData::mode.

Referenced by getMinimapTexture().

+ Here is the caller graph for this function:

◆ blitMinimapPixelsToImageSurface()

void Minimap::blitMinimapPixelsToImageSurface ( video::IImage *  map_image,
video::IImage *  heightmap_image 
)

References TileDef::color, data, NodeDefManager::get(), MapNode::getColor(), TileDef::has_color, MinimapPixel::height, m_ndef, MinimapModeDef::map_size, ContentFeatures::minimap_color, MinimapData::minimap_scan, MinimapData::mode, MinimapPixel::n, and ContentFeatures::tiledef.

Referenced by getMinimapTexture().

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

◆ clearModes()

void Minimap::clearModes ( )
inline

References m_modes.

Referenced by Client::handleCommand_MinimapModes().

+ Here is the caller graph for this function:

◆ drawMinimap() [1/2]

void Minimap::drawMinimap ( )

References RenderingEngine::get_instance(), and RenderingEngine::getWindowSize().

Referenced by RenderingCore::drawHUD().

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

◆ drawMinimap() [2/2]

◆ getAngle()

f32 Minimap::getAngle ( ) const
inline

References m_angle.

Referenced by LuaMinimap::l_get_angle().

+ Here is the caller graph for this function:

◆ getMaxModeIndex()

size_t Minimap::getMaxModeIndex ( ) const
inline

References m_modes.

Referenced by LuaMinimap::l_set_mode(), and LuaMinimap::l_show().

+ Here is the caller graph for this function:

◆ getMinimapMeshBuffer()

scene::SMeshBuffer * Minimap::getMinimapMeshBuffer ( )

Referenced by Minimap().

+ Here is the caller graph for this function:

◆ getMinimapShape()

MinimapShape Minimap::getMinimapShape ( )

References data, MINIMAP_SHAPE_ROUND, MinimapData::minimap_shape_round, and MINIMAP_SHAPE_SQUARE.

Referenced by LuaMinimap::l_get_shape().

+ Here is the caller graph for this function:

◆ getMinimapTexture()

video::ITexture * Minimap::getMinimapTexture ( )

References blitMinimapPixelsToImageRadar(), blitMinimapPixelsToImageSurface(), data, driver, ITextureSource::getTexture(), MinimapData::heightmap_texture, m_tsrc, MinimapData::map_invalidated, MinimapModeDef::map_size, MinimapData::minimap_mask_round, MinimapData::minimap_mask_square, MINIMAP_MAX_SX, MINIMAP_MAX_SY, MinimapData::minimap_shape_round, MINIMAP_TYPE_OFF, MINIMAP_TYPE_RADAR, MINIMAP_TYPE_SURFACE, MINIMAP_TYPE_TEXTURE, MinimapData::mode, MinimapData::pos, MinimapModeDef::scale, MinimapModeDef::texture, MinimapData::texture, and MinimapModeDef::type.

Referenced by drawMinimap().

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

◆ getModeDef()

MinimapModeDef Minimap::getModeDef ( ) const
inline

References data, and MinimapData::mode.

Referenced by Client::handleCommand_HudSetFlags(), and Game::toggleMinimap().

+ Here is the caller graph for this function:

◆ getModeIndex()

size_t Minimap::getModeIndex ( ) const
inline

References m_current_mode_index.

Referenced by Client::handleCommand_HudSetFlags(), LuaMinimap::l_get_mode(), LuaMinimap::l_hide(), LuaMinimap::l_show(), and Game::toggleMinimap().

+ Here is the caller graph for this function:

◆ getPos()

v3s16 Minimap::getPos ( ) const
inline

References data, and MinimapData::pos.

Referenced by LuaMinimap::l_get_pos().

+ Here is the caller graph for this function:

◆ getYawVec()

v3f Minimap::getYawVec ( )

References data, m_angle, and MinimapData::minimap_shape_round.

Referenced by GameGlobalShaderConstantSetter::onSetConstants().

+ Here is the caller graph for this function:

◆ nextMode()

void Minimap::nextMode ( )

References m_current_mode_index, m_modes, and setModeIndex().

Referenced by Client::handleCommand_HudSetFlags(), and Game::toggleMinimap().

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

◆ removeMarker()

void Minimap::removeMarker ( MinimapMarker **  marker)

References m_markers.

Referenced by GenericCAO::removeFromScene(), and GenericCAO::updateMarker().

+ Here is the caller graph for this function:

◆ setAngle()

void Minimap::setAngle ( f32  angle)

References m_angle.

Referenced by LuaMinimap::l_set_angle(), and Game::updateFrame().

+ Here is the caller graph for this function:

◆ setMinimapShape()

void Minimap::setMinimapShape ( MinimapShape  shape)

References data, UpdateThread::deferUpdate(), g_settings, m_minimap_update_thread, m_mutex, MINIMAP_SHAPE_ROUND, MinimapData::minimap_shape_round, MINIMAP_SHAPE_SQUARE, and Settings::setBool().

Referenced by LuaMinimap::l_set_shape().

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

◆ setModeIndex()

void Minimap::setModeIndex ( size_t  index)

References data, UpdateThread::deferUpdate(), m_current_mode_index, m_minimap_update_thread, m_modes, m_mutex, MinimapData::map_invalidated, MINIMAP_TYPE_OFF, and MinimapData::mode.

Referenced by Minimap(), Client::handleCommand_HudSetFlags(), Client::handleCommand_MinimapModes(), LuaMinimap::l_hide(), LuaMinimap::l_set_mode(), LuaMinimap::l_show(), and nextMode().

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

◆ setPos()

void Minimap::setPos ( v3s16  pos)

References data, UpdateThread::deferUpdate(), m_minimap_update_thread, m_mutex, MinimapData::old_pos, and MinimapData::pos.

Referenced by LuaMinimap::l_set_pos(), and Game::updateFrame().

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

◆ toggleMinimapShape()

void Minimap::toggleMinimapShape ( )

References data, UpdateThread::deferUpdate(), g_settings, m_minimap_update_thread, m_mutex, MinimapData::minimap_shape_round, and Settings::setBool().

Referenced by Game::toggleMinimap().

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

◆ updateActiveMarkers()

void Minimap::updateActiveMarkers ( )

References BS, data, floatToInt(), intToFloat(), m_active_markers, m_markers, MinimapModeDef::map_size, MinimapData::minimap_mask_round, MinimapData::minimap_mask_square, MINIMAP_MAX_SX, MINIMAP_MAX_SY, MinimapData::minimap_shape_round, MinimapData::mode, MinimapData::pos, and MinimapModeDef::scan_height.

Referenced by drawMinimap().

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

Member Data Documentation

◆ client

Client* Minimap::client

Referenced by Minimap().

◆ data

◆ driver

video::IVideoDriver* Minimap::driver

◆ m_active_markers

std::list<v2f> Minimap::m_active_markers
private

Referenced by drawMinimap(), and updateActiveMarkers().

◆ m_angle

f32 Minimap::m_angle
private

◆ m_current_mode_index

size_t Minimap::m_current_mode_index
private

◆ m_enable_shaders

bool Minimap::m_enable_shaders
private

Referenced by Minimap(), and drawMinimap().

◆ m_markers

std::list<MinimapMarker*> Minimap::m_markers
private

◆ m_meshbuffer

scene::SMeshBuffer* Minimap::m_meshbuffer
private

Referenced by Minimap(), ~Minimap(), and drawMinimap().

◆ m_minimap_update_thread

MinimapUpdateThread* Minimap::m_minimap_update_thread = nullptr
private

◆ m_modes

std::vector<MinimapModeDef> Minimap::m_modes
private

◆ m_mutex

std::mutex Minimap::m_mutex
private

◆ m_ndef

const NodeDefManager* Minimap::m_ndef
private

◆ m_shdrsrc

IShaderSource* Minimap::m_shdrsrc
private

Referenced by Minimap(), and drawMinimap().

◆ m_surface_mode_scan_height

u16 Minimap::m_surface_mode_scan_height
private

Referenced by Minimap(), and addMode().

◆ m_tsrc

ITextureSource* Minimap::m_tsrc
private

Referenced by Minimap(), and getMinimapTexture().


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