aboutsummaryrefslogtreecommitdiff
path: root/src/remoteplayer.cpp
Commit message (Expand)AuthorAge
* RemotePlayer: Remove Settings writer to Files databaseSmallJoker2021-01-29
* Sky API: Rename *_tint to fog_*_tint for consistencySmallJoker2020-05-05
* Move PlayerSAO to dedicated filesLoic Blot2020-04-11
* set_sky improvements, set_sun, set_moon and set_starsJordach2020-03-05
* Consistent HP and damage types (#8167)SmallJoker2019-02-10
* Fix on_successful_save -> onSuccessfulSaveLoïc Blot2019-01-04
* Fix various player save issues (performance penalty on sql backends + bugs)Loïc Blot2019-01-04
* Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)CoderForTheBetter2018-11-28
* Inv deSerialize(): Prevent infinite loop, error on failure (#7711)SmallJoker2018-09-14
* Fix builtin inventory list crash when size = 0 (#7297)SmallJoker2018-05-05
* Add player:get_meta(), deprecate player attributes (#7202)rubenwardy2018-04-06
* Update JsonCPP to 1.8.3 (#6466)Loïc Blot2017-09-26
* Respect object property hp_max field for players (#6287)SmallJoker2017-08-23
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)Loïc Blot2017-08-19
* Cpp11 patchset 11: continue working on constructor style migration (#6004)Loïc Blot2017-06-18
* Clouds: Fix reddish clouds. Add missing alpha updateparamat2017-05-04
* Add clouds APIBen Deutsch2017-04-30
* Player data to Database (#5475)Loïc Blot2017-04-23
* Some performance optimizations (#5424)Loïc Blot2017-03-22
* Add ModMetadata API (#5131)Loïc Blot2017-02-08
* Implement player attribute backend (#4155)Loïc Blot2017-01-27
* Breath cheat fix: server sideLoic Blot2017-01-01
* PlayerSAO saving fix (#4734)Ner'zhul2016-11-05
* Fix overloading problems mentioned by clangLoic Blot2016-10-30
* PlayerSAO/LocalPlayer refactor: (#4612)Ner'zhul2016-10-30
* Move RemotePlayer code to its own cpp/headerLoic Blot2016-10-08
F, MINIMAP_MODE_SURFACEx1, MINIMAP_MODE_SURFACEx2, MINIMAP_MODE_SURFACEx4, MINIMAP_MODE_RADARx1, MINIMAP_MODE_RADARx2, MINIMAP_MODE_RADARx4, MINIMAP_MODE_COUNT, }; enum MinimapShape { MINIMAP_SHAPE_SQUARE, MINIMAP_SHAPE_ROUND, }; struct MinimapModeDef { bool is_radar; u16 scan_height; u16 map_size; }; struct MinimapPixel { //! The topmost node that the minimap displays. MapNode n; u16 height; u16 air_count; }; struct MinimapMapblock { void getMinimapNodes(VoxelManipulator *vmanip, v3s16 pos); MinimapPixel data[MAP_BLOCKSIZE * MAP_BLOCKSIZE]; }; struct MinimapData { bool is_radar; MinimapMode mode; v3s16 pos; v3s16 old_pos; u16 scan_height; u16 map_size; MinimapPixel minimap_scan[MINIMAP_MAX_SX * MINIMAP_MAX_SY]; bool map_invalidated; bool minimap_shape_round; video::IImage *minimap_image; video::IImage *heightmap_image; video::IImage *minimap_mask_round; video::IImage *minimap_mask_square; video::ITexture *texture; video::ITexture *heightmap_texture; video::ITexture *minimap_overlay_round; video::ITexture *minimap_overlay_square; video::ITexture *player_marker; video::ITexture *object_marker_red; }; struct QueuedMinimapUpdate { v3s16 pos; MinimapMapblock *data; }; class MinimapUpdateThread : public UpdateThread { public: MinimapUpdateThread() : UpdateThread("Minimap") {} 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); MinimapData *data; protected: virtual void doUpdate(); private: Mutex m_queue_mutex; std::deque<QueuedMinimapUpdate> m_update_queue; std::map<v3s16, MinimapMapblock *> m_blocks_cache; }; class Minimap { public: Minimap(IrrlichtDevice *device, Client *client); ~Minimap(); void addBlock(v3s16 pos, MinimapMapblock *data); v3f getYawVec(); void setPos(v3s16 pos); v3s16 getPos() const { return data->pos; } void setAngle(f32 angle); f32 getAngle() const { return m_angle; } void setMinimapMode(MinimapMode mode); MinimapMode getMinimapMode() const { return data->mode; } void toggleMinimapShape(); void setMinimapShape(MinimapShape shape); MinimapShape getMinimapShape(); video::ITexture *getMinimapTexture(); void blitMinimapPixelsToImageRadar(video::IImage *map_image); void blitMinimapPixelsToImageSurface(video::IImage *map_image, video::IImage *heightmap_image); scene::SMeshBuffer *getMinimapMeshBuffer(); void updateActiveMarkers(); void drawMinimap(); video::IVideoDriver *driver; Client* client; MinimapData *data; private: ITextureSource *m_tsrc; IShaderSource *m_shdrsrc; INodeDefManager *m_ndef; MinimapUpdateThread *m_minimap_update_thread; scene::SMeshBuffer *m_meshbuffer; bool m_enable_shaders; u16 m_surface_mode_scan_height; f32 m_angle; Mutex m_mutex; std::list<v2f> m_active_markers; }; #endif