#include <minimap.h>
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 () |
MinimapMarker * | addMarker (scene::ISceneNode *parent_node) |
void | removeMarker (MinimapMarker **marker) |
void | updateActiveMarkers () |
void | drawMinimap (core::rect< s32 > rect) |
Public Attributes | |
video::IVideoDriver * | driver |
Client * | client |
std::unique_ptr< MinimapData > | data |
Private Attributes | |
ITextureSource * | m_tsrc |
IShaderSource * | m_shdrsrc |
const NodeDefManager * | m_ndef |
std::unique_ptr< MinimapUpdateThread > | m_minimap_update_thread |
irr_ptr< scene::SMeshBuffer > | m_meshbuffer |
bool | m_enable_shaders |
std::vector< MinimapModeDef > | m_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< v2f > | m_active_markers |
Minimap::Minimap | ( | Client * | client | ) |
References addMode(), client, createMinimapMeshBuffer(), data, MinimapUpdateThread::data, driver, g_settings, RenderingEngine::get_video_driver(), Settings::getBool(), Client::getNodeDefManager(), Client::getShaderSource(), Client::getTextureSource(), m_angle, m_current_mode_index, m_enable_shaders, m_meshbuffer, m_minimap_update_thread, m_ndef, m_shdrsrc, m_surface_mode_scan_height, m_tsrc, MinimapData::map_invalidated, MinimapData::minimap_shape_round, MINIMAP_TYPE_OFF, MINIMAP_TYPE_RADAR, MINIMAP_TYPE_SURFACE, setModeIndex(), and Thread::start().
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().
void Minimap::addBlock | ( | v3s16 | pos, |
MinimapMapblock * | data ) |
References data, MinimapUpdateThread::enqueueBlock(), and m_minimap_update_thread.
Referenced by Client::step().
MinimapMarker * Minimap::addMarker | ( | scene::ISceneNode * | parent_node | ) |
References m_markers.
Referenced by GenericCAO::updateMarker().
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().
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.
void Minimap::blitMinimapPixelsToImageRadar | ( | video::IImage * | map_image | ) |
References MinimapPixel::air_count, data, MinimapModeDef::map_size, MinimapData::minimap_scan, and MinimapData::mode.
Referenced by getMinimapTexture().
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().
|
inline |
References m_modes.
Referenced by Client::handleCommand_MinimapModes().
irr_ptr< scene::SMeshBuffer > Minimap::createMinimapMeshBuffer | ( | ) |
void Minimap::drawMinimap | ( | core::rect< s32 > | rect | ) |
References data, driver, getMinimapTexture(), IShaderSource::getShader(), IShaderSource::getShaderInfo(), ITextureSource::getTexture(), MinimapData::heightmap_texture, m_active_markers, m_angle, m_enable_shaders, m_meshbuffer, m_shdrsrc, m_tsrc, ShaderInfo::material, MinimapData::minimap_overlay_round, MinimapData::minimap_overlay_square, MinimapData::minimap_shape_round, MINIMAP_TYPE_OFF, MINIMAP_TYPE_SURFACE, MinimapData::mode, MinimapData::object_marker_red, MinimapData::player_marker, MinimapData::textures_initialised, TILE_MATERIAL_ALPHA, MinimapModeDef::type, and updateActiveMarkers().
|
inline |
References m_angle.
Referenced by LuaMinimap::l_get_angle().
|
inline |
References m_modes.
Referenced by LuaMinimap::l_set_mode(), and LuaMinimap::l_show().
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().
MinimapShape Minimap::getMinimapShape | ( | ) |
References data, MINIMAP_SHAPE_ROUND, MinimapData::minimap_shape_round, and MINIMAP_SHAPE_SQUARE.
Referenced by LuaMinimap::l_get_shape().
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().
|
inline |
References data, and MinimapData::mode.
Referenced by Client::handleCommand_HudSetFlags(), and Game::toggleMinimap().
|
inline |
References m_current_mode_index.
Referenced by Client::handleCommand_HudSetFlags(), LuaMinimap::l_get_mode(), LuaMinimap::l_hide(), LuaMinimap::l_show(), and Game::toggleMinimap().
|
inline |
References data, and MinimapData::pos.
Referenced by LuaMinimap::l_get_pos().
v3f Minimap::getYawVec | ( | ) |
References data, m_angle, and MinimapData::minimap_shape_round.
Referenced by GameGlobalShaderConstantSetter::onSetConstants().
void Minimap::nextMode | ( | ) |
References m_current_mode_index, m_modes, and setModeIndex().
Referenced by Client::handleCommand_HudSetFlags(), and Game::toggleMinimap().
void Minimap::removeMarker | ( | MinimapMarker ** | marker | ) |
References m_markers.
Referenced by GenericCAO::removeFromScene(), and GenericCAO::updateMarker().
void Minimap::setAngle | ( | f32 | angle | ) |
References m_angle.
Referenced by LuaMinimap::l_set_angle(), and Game::updateFrame().
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().
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().
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().
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().
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().
std::unique_ptr<MinimapData> Minimap::data |
Referenced by Minimap(), ~Minimap(), addBlock(), blitMinimapPixelsToImageRadar(), blitMinimapPixelsToImageSurface(), drawMinimap(), getMinimapMask(), getMinimapShape(), getMinimapTexture(), getModeDef(), getPos(), getYawVec(), setMinimapShape(), setModeIndex(), setPos(), toggleMinimapShape(), and updateActiveMarkers().
video::IVideoDriver* Minimap::driver |
Referenced by Minimap(), ~Minimap(), drawMinimap(), getMinimapMask(), and getMinimapTexture().
|
private |
Referenced by drawMinimap(), and updateActiveMarkers().
|
private |
Referenced by Minimap(), drawMinimap(), getAngle(), getYawVec(), and setAngle().
|
private |
Referenced by Minimap(), getModeIndex(), nextMode(), and setModeIndex().
|
private |
Referenced by Minimap(), and drawMinimap().
|
private |
Referenced by ~Minimap(), addMarker(), removeMarker(), and updateActiveMarkers().
|
private |
Referenced by Minimap(), ~Minimap(), and drawMinimap().
|
private |
Referenced by Minimap(), ~Minimap(), addBlock(), setMinimapShape(), setModeIndex(), setPos(), and toggleMinimapShape().
|
private |
Referenced by addMode(), clearModes(), getMaxModeIndex(), nextMode(), and setModeIndex().
|
private |
Referenced by setMinimapShape(), setModeIndex(), setPos(), and toggleMinimapShape().
|
private |
Referenced by Minimap(), and blitMinimapPixelsToImageSurface().
|
private |
Referenced by Minimap(), and drawMinimap().
|
private |
Referenced by Minimap(), drawMinimap(), getMinimapMask(), and getMinimapTexture().