Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
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, const std::string &label="", const 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::IImage * getMinimapMask ()
 
video::ITexture * getMinimapTexture ()
 
void blitMinimapPixelsToImageRadar (video::IImage *map_image)
 
void blitMinimapPixelsToImageSurface (video::IImage *map_image, video::IImage *heightmap_image)
 
irr_ptr< scene::SMeshBuffer > createMinimapMeshBuffer ()
 
MinimapMarkeraddMarker (scene::ISceneNode *parent_node)
 
void removeMarker (MinimapMarker **marker)
 
void updateActiveMarkers ()
 
void drawMinimap (core::rect< s32 > rect)
 

Public Attributes

video::IVideoDriver * driver
 
Clientclient
 
std::unique_ptr< MinimapDatadata
 

Private Attributes

ITextureSourcem_tsrc
 
IShaderSourcem_shdrsrc
 
const NodeDefManagerm_ndef
 
std::unique_ptr< MinimapUpdateThreadm_minimap_update_thread
 
irr_ptr< scene::SMeshBuffer > m_meshbuffer
 
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< std::unique_ptr< MinimapMarker > > m_markers
 
std::list< v2fm_active_markers
 

Constructor & Destructor Documentation

◆ Minimap()

◆ ~Minimap()

Minimap::~Minimap ( )

References data, driver, MinimapData::heightmap_texture, m_markers, m_meshbuffer, m_minimap_update_thread, MinimapData::minimap_mask_round, MinimapData::minimap_mask_square, UpdateThread::stop(), MinimapData::texture, and Thread::wait().

+ Here is the call graph for this function:

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,
const std::string & label = "",
const 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, 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:

◆ createMinimapMeshBuffer()

irr_ptr< scene::SMeshBuffer > Minimap::createMinimapMeshBuffer ( )

Referenced by Minimap().

+ Here is the caller graph for this function:

◆ drawMinimap()

◆ 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:

◆ getMinimapMask()

video::IImage * Minimap::getMinimapMask ( )

References data, driver, ITextureSource::getTexture(), m_tsrc, MinimapData::minimap_mask_round, MinimapData::minimap_mask_square, MINIMAP_MAX_SX, MINIMAP_MAX_SY, and MinimapData::minimap_shape_round.

Referenced by getMinimapTexture(), and updateActiveMarkers().

+ Here is the call graph for this function:
+ 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, getMinimapMask(), ITextureSource::getTexture(), MinimapData::heightmap_texture, m_tsrc, MinimapData::map_invalidated, MinimapModeDef::map_size, MINIMAP_MAX_SX, MINIMAP_MAX_SY, MINIMAP_TYPE_OFF, MINIMAP_TYPE_RADAR, MINIMAP_TYPE_SURFACE, MINIMAP_TYPE_TEXTURE, MinimapData::mode, MinimapData::pos, MinimapModeDef::scale, MinimapData::texture, MinimapModeDef::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_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(), getMinimapMask(), intToFloat(), m_active_markers, m_markers, MinimapModeDef::map_size, MINIMAP_MAX_SX, MINIMAP_MAX_SY, 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_markers

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

◆ m_meshbuffer

irr_ptr<scene::SMeshBuffer> Minimap::m_meshbuffer
private

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

◆ m_minimap_update_thread

std::unique_ptr<MinimapUpdateThread> Minimap::m_minimap_update_thread
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

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