aboutsummaryrefslogtreecommitdiff
path: root/src/client
Commit message (Expand)AuthorAge
...
* Load client mods into memory before execution.sfan52019-11-09
* Formspec: draw order and clipping for all elements (#8740)DS2019-11-07
* Clean up font caching, fix bitmap fontsSmallJoker2019-11-03
* Formspec: add hypertext elementPierre-Yves Rollo2019-11-03
* Correction for alpha blending issues in texture mod compositing (#9029)Warr10242019-10-18
* Fix isDead()/autoforward crash (#9031)Paramat2019-10-09
* ContentCAO: Fix segfault on quit (attached)SmallJoker2019-10-09
* Revert Client::sendPlayerPos optimization (part of 81c7f0a) (#9025)ANAND2019-10-08
* Fix upright_sprite lighting when colors are setsfan52019-10-06
* Fix unwanted detaching when damage = 0Jacob Lifshay2019-10-05
* Attachments: Fix attachments to temporary removed objects (#8989)SmallJoker2019-10-02
* Textures: Load base pack only as last fallback (#8974)SmallJoker2019-09-29
* Move Quicktune code to util/ (#8871)ANAND2019-09-29
* Simple shader fixes. (#8991)lhofhansl2019-09-26
* Fix some reference counters (memleak) (#8981)SmallJoker2019-09-24
* Move the code for meta formspec into bool Game::nodePlacement(const ItemDefin...DS-Minetest2019-09-22
* Add support for per-player FOV overrides and multipliersAnand S2019-09-19
* Trigger on_place in many situations even if prediction failedDS-Minetest2019-09-19
* Improve undersampling settingsHugo Locurcio2019-09-17
* Built-in formspecs: Force version 1SmallJoker2019-09-14
* client.h: Add missing const'sANAND2019-09-14
* LocalPlayer: Fix code-styleANAND2019-09-14
* client.cpp: Fix code-style in Client::sendPlayerPosANAND2019-09-14
* Fix LocalPlayer::isDead always returning false if player is immortalANAND2019-09-14
* Send ActiveObjects once right after Init2ANAND2019-09-14
* Formspecs: Introduce formspec_version to modsSmallJoker2019-09-14
* Load CSM environment after the restrictions are knownSmallJoker2019-09-14
* particles.cpp: Fix code-styleANAND2019-08-31
* clientobject.h: Fix code-styleANAND2019-08-31
* Fix rotation of attached particlespawnerPedro Gimeno2019-08-31
* fontengine: Fix non-gettext buildsSmallJoker2019-08-24
* Inventory: Send dirty lists where appropriate (#8742)SmallJoker2019-08-24
* Occlusion: Check for light_propagates and do mapblock bounds checksSmallJoker2019-08-23
* Occlusion: Begin cleanupSmallJoker2019-08-23
* Revert "Don't send position update packet if player is dead"sfan52019-08-21
* Don't send position update packet if player is deadANAND2019-08-20
* Disable autoforward if player is deadANAND2019-08-20
* Restore intended functionality to minimap markers (#8819)theviper1212019-08-19
* Fix unnecessary exception use in Map::getSectorXXX (#8792)Jozef Behran2019-08-13
* Better F6 profiler (#8750)SmallJoker2019-08-13
* Merge pull request #8776 from osjc/FixGetNodeJozef Behran2019-08-10
* Implement adding velocity to player from Luasfan52019-08-10
* Game: Fix double BS multiplicationSmallJoker2019-08-07
* Client::Interact: Use InteractAction enum instead of numeric constantsANAND2019-08-07
* Unify wield item handling (#8677)SmallJoker2019-08-07
* Hide chat when console is open (#8656)ANAND2019-08-07
* Fix inventory_overlay for nodes without inventory_image (#8433)DS2019-08-07
* Optimize usage of TOSERVER_GOTBLOCKS packetsfan52019-08-07
* Clean up and fix freetype=false crashes (#8641)SmallJoker2019-08-06
* Unify GLES support in gui scaling filtersfan52019-08-04
/span> GENNOTIFY_LARGECAVE_END, GENNOTIFY_DECORATION, NUM_GENNOTIFY_TYPES }; struct GenNotifyEvent { GenNotifyType type; v3s16 pos; u32 id; }; class GenerateNotifier { public: GenerateNotifier() = default; GenerateNotifier(u32 notify_on, const std::set<u32> *notify_on_deco_ids); void setNotifyOn(u32 notify_on); void setNotifyOnDecoIds(const std::set<u32> *notify_on_deco_ids); bool addEvent(GenNotifyType type, v3s16 pos, u32 id=0); void getEvents(std::map<std::string, std::vector<v3s16> > &event_map); void clearEvents(); private: u32 m_notify_on = 0; const std::set<u32> *m_notify_on_deco_ids; std::list<GenNotifyEvent> m_notify_events; }; // Order must match the order of 'static MapgenDesc g_reg_mapgens[]' in mapgen.cpp enum MapgenType { MAPGEN_V7, MAPGEN_VALLEYS, MAPGEN_CARPATHIAN, MAPGEN_V5, MAPGEN_FLAT, MAPGEN_FRACTAL, MAPGEN_SINGLENODE, MAPGEN_V6, MAPGEN_INVALID, }; struct MapgenParams { MapgenParams() = default; virtual ~MapgenParams(); MapgenType mgtype = MAPGEN_DEFAULT; s16 chunksize = 5; u64 seed = 0; s16 water_level = 1; s16 mapgen_limit = MAX_MAP_GENERATION_LIMIT; // Flags set in readParams u32 flags = 0; u32 spflags = 0; BiomeParams *bparams = nullptr; s16 mapgen_edge_min = -MAX_MAP_GENERATION_LIMIT; s16 mapgen_edge_max = MAX_MAP_GENERATION_LIMIT; virtual void readParams(const Settings *settings); virtual void writeParams(Settings *settings) const; // Default settings for g_settings such as flags virtual void setDefaultSettings(Settings *settings) {}; s32 getSpawnRangeMax(); private: void calcMapgenEdges(); bool m_mapgen_edges_calculated = false; }; /* Generic interface for map generators. All mapgens must inherit this class. If a feature exposed by a public member pointer is not supported by a certain mapgen, it must be set to NULL. Apart from makeChunk, getGroundLevelAtPoint, and getSpawnLevelAtPoint, all methods can be used by constructing a Mapgen base class and setting the appropriate public members (e.g. vm, ndef, and so on). */ class Mapgen { public: s32 seed = 0; int water_level = 0; int mapgen_limit = 0; u32 flags = 0; bool generating = false; int id = -1; MMVManip *vm = nullptr; const NodeDefManager *ndef = nullptr; u32 blockseed; s16 *heightmap = nullptr; biome_t *biomemap = nullptr; v3s16 csize; BiomeGen *biomegen = nullptr; GenerateNotifier gennotify; Mapgen() = default; Mapgen(int mapgenid, MapgenParams *params, EmergeParams *emerge); virtual ~Mapgen() = default; DISABLE_CLASS_COPY(Mapgen); virtual MapgenType getType() const { return MAPGEN_INVALID; } static u32 getBlockSeed(v3s16 p, s32 seed); static u32 getBlockSeed2(v3s16 p, s32 seed); s16 findGroundLevelFull(v2s16 p2d); s16 findGroundLevel(v2s16 p2d, s16 ymin, s16 ymax); s16 findLiquidSurface(v2s16 p2d, s16 ymin, s16 ymax); void updateHeightmap(v3s16 nmin, v3s16 nmax); void getSurfaces(v2s16 p2d, s16 ymin, s16 ymax, std::vector<s16> &floors, std::vector<s16> &ceilings); void updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nmax); void setLighting(u8 light, v3s16 nmin, v3s16 nmax); void lightSpread(VoxelArea &a, std::queue<std::pair<v3s16, u8>> &queue, const v3s16 &p, u8 light); void calcLighting(v3s16 nmin, v3s16 nmax, v3s16 full_nmin, v3s16 full_nmax, bool propagate_shadow = true); void propagateSunlight(v3s16 nmin, v3s16 nmax, bool propagate_shadow); void spreadLight(const v3s16 &nmin, const v3s16 &nmax); virtual void makeChunk(BlockMakeData *data) {} virtual int getGroundLevelAtPoint(v2s16 p) { return 0; } // getSpawnLevelAtPoint() is a function within each mapgen that returns a // suitable y co-ordinate for player spawn ('suitable' usually meaning // within 16 nodes of water_level). If a suitable spawn level cannot be // found at the specified (X, Z) 'MAX_MAP_GENERATION_LIMIT' is returned to // signify this and to cause Server::findSpawnPos() to try another (X, Z). virtual int getSpawnLevelAtPoint(v2s16 p) { return 0; } // Mapgen management functions static MapgenType getMapgenType(const std::string &mgname); static const char *getMapgenName(MapgenType mgtype); static Mapgen *createMapgen(MapgenType mgtype, MapgenParams *params, EmergeParams *emerge); static MapgenParams *createMapgenParams(MapgenType mgtype); static void getMapgenNames(std::vector<const char *> *mgnames, bool include_hidden); static void setDefaultSettings(Settings *settings); private: // isLiquidHorizontallyFlowable() is a helper function for updateLiquid() // that checks whether there are floodable nodes without liquid beneath // the node at index vi. inline bool isLiquidHorizontallyFlowable(u32 vi, v3s16 em); }; /* MapgenBasic is a Mapgen implementation that handles basic functionality the majority of conventional mapgens will probably want to use, but isn't generic enough to be included as part of the base Mapgen class (such as generating biome terrain over terrain node skeletons, generating caves, dungeons, etc.) Inherit MapgenBasic instead of Mapgen to add this basic functionality to your mapgen without having to reimplement it. Feel free to override any of these methods if you desire different or more advanced behavior. Note that you must still create your own generateTerrain implementation when inheriting MapgenBasic. */ class MapgenBasic : public Mapgen { public: MapgenBasic(int mapgenid, MapgenParams *params, EmergeParams *emerge); virtual ~MapgenBasic(); virtual void generateBiomes(); virtual void dustTopNodes(); virtual void generateCavesNoiseIntersection(s16 max_stone_y); virtual void generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_ymax); virtual bool generateCavernsNoise(s16 max_stone_y); virtual void generateDungeons(s16 max_stone_y); protected: EmergeParams *m_emerge; BiomeManager *m_bmgr; Noise *noise_filler_depth; v3s16 node_min; v3s16 node_max; v3s16 full_node_min; v3s16 full_node_max; content_t c_stone; content_t c_water_source; content_t c_river_water_source; content_t c_lava_source; content_t c_cobble; int ystride; int zstride; int zstride_1d; int zstride_1u1d; u32 spflags; NoiseParams np_cave1; NoiseParams np_cave2; NoiseParams np_cavern; NoiseParams np_dungeons; float cave_width; float cavern_limit; float cavern_taper; float cavern_threshold; int small_cave_num_min; int small_cave_num_max; int large_cave_num_min; int large_cave_num_max; float large_cave_flooded; s16 large_cave_depth; s16 dungeon_ymin; s16 dungeon_ymax; };