aboutsummaryrefslogtreecommitdiff
path: root/src/mapnode.cpp
AgeCommit message (Collapse)Author
2022-11-09Fix typos and en_US/en_GB inconsistency in various files (#12902)Abdou-31
2022-10-09Optimize lighting calculation (#12797)Jude Melton-Houghton
2022-09-16Add paramtype2s for 4 horizontal rotations and 64 colors (#11431)Wuzzy
4dir is like facedir, but only for 4 horizontal directions: NESW. It is identical in behavior to facedir otherwise. The reason why game makers would want to use this over facedir is 1) simplicity and 2) you get 6 free bits. It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir). color4dir is like colorfacedir, but you get 64 colors instead of only 8.
2022-05-26Reduce size of ContentFeatures structuresfan5
On my system this is a reduction from 4664 to 3704 bytes. This is not for the sake of saving RAM but ensuring commonly used structures fit into caches better.
2021-08-31Switch MapBlock compression to zstd (#10788)lhofhansl
* Add zstd support. * Rearrange serialization order * Compress entire mapblock Co-authored-by: sfan5 <sfan5@live.de>
2021-07-15Add wallmounted support for plantlike and plantlike_rooted nodes (#11379)Wuzzy
2021-04-20Put torch/signlike node on floor if no paramtype2 (#11074)Wuzzy
2021-03-30Degrotate support for mesh nodes (#7840)Vitaliy
2020-12-15Allow configuring block disk and net compression. Change default disk level.Lars
2020-05-20Cache liquid alternative IDs (#8053)Vitaliy
2020-05-19Rework functionality of leveled nodes (#9852)Wuzzy
Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2019-10-24Change some rough/inappropriate language in comments (#9061)random-geek
2019-08-10Merge pull request #8776 from osjc/FixGetNodeJozef Behran
Finish getNode cleanup
2019-03-07Abort when trying to set a not registered node (#7011)HybridDog
I removed the MapNode constructor which takes a nodename and gives the node's id or CONTENT_IGNORE The code which used this constructor (two places) now handles the situation of not registered nodes correctly: * minetest.set_node and similar functions make minetest crash when a not registered node is passed * reverting a node with rollback aborts if the node is not registered
2018-12-22mapnode: add const/noexcept (#8009)Vitaliy
2018-12-12Make MapNode handle paramtype2≠leveled properly (#7958)Vitaliy
2018-02-10Node definition manager refactor (#7016)Dániel Juhász
* Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager
2018-01-03Connected Nodeboxes: Add `disconnected` boxesThomas--S
The `disconnected_*` boxes are the opposites of the `connect_*` ones, i.e. when a node has no suitable neighbours on the respective side, the according disconnected box is drawn. * disconnected_top * disconnected_bottom * disconnected_front * disconnected_left * disconnected_back * disconnected_right * disconnected (when there is *no* neighbour) * disconnected_sides (when there are *no* neighbours to the sides)
2017-10-15Real global textures (#6105)Vitaliy
* Real global textures * Add world-aligned textures * Update minimal to support world-aligned tiles * Update minimal
2017-09-18Leveled nodebox: Change levels from 1/63rds to 1/64thsparamat
Add missing documentation of leveled nodebox to lua_api.txt, plus a little cleaning up nearby.
2017-08-20Modernize source code: last part (#6285)Loïc Blot
* Modernize source code: last par * Use empty when needed * Use emplace_back instead of push_back when needed * For range-based loops * Initializers fixes * constructors, destructors default * c++ C stl includes
2017-08-19Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)Loïc Blot
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Spelling: vertice -> vertex
2017-08-19Code modernization: src/m* (part 3)Loic Blot
* empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * remove some unused headers in some cpp variable
2017-08-18Modernize various files (src/m*) (#6267)Loïc Blot
* Modernize various files (src/m*) * range-based for loops * code style * C++ headers instead of C headers * Default operators * empty function Thanks to clang-tidy
2017-07-27compressZlib: don't use a SharedBuffer but a raw u8 * pointerLoic Blot
Remove usage of the SharedBuffer in zlib compression which has two problems: * We copied the whole memory block to compress it (not good with mapblocks) * We copied sometimes strings to SharedBuffer to SharedBuffer (2nd time) Use this method in MapNode::serializeBulk + optimize serialization but merging 3 identical loops in a single loop
2017-06-06Revert "Remove deprecated code segments (#5891)"Loïc Blot
This reverts commit 599e13e95e81aadb959c9f3715aec9b425ede084.
2017-06-04Remove deprecated code segments (#5891)Thomas--S
2017-01-23Add hardware node coloring. Includes:Dániel Juhász
- Increase ContentFeatures serialization version - Color property and palettes for nodes - paramtype2 = "color", "colored facedir" or "colored wallmounted"
2017-01-04Improve getPointedThing() (#4346)Dániel Juhász
* Improved getPointedThing() The new algorithm checks every node exactly once. Now the point and normal vector of the collision is also returned in the PointedThing (currently they are not used outside of the function). Now the CNodeDefManager keeps the union of all possible nodeboxes, so the raycast won't miss any nodes. Also if there are only small nodeboxes, getPointedThing() is exceptionally fast. Also adds unit test for VoxelLineIterator. * Cleanup, code move This commit moves getPointedThing() and Client::getSelectedActiveObject() to ClientEnvironment. The map nodes now can decide which neighbors they are connecting to (MapNode::getNeighbors()).
2016-10-27Improved lightingDániel Juhász
This commit rewrites the procedure that is responsible for light updating. this commit -provides iterative solutions for unlighting and light spreading -introduces a new priority queue-like container for the iteration -creates per-node MapBlock caching to reduce retrieving MapBlocks from the map -calculates with map block positions and in-block relative node coordinates -skips light updating if it is not necessary since the node's new light will be the same as its old light was
2016-03-21Fix connected nodes' selection boxes.Auke Kok
This allows the player to more easily target and punch connected nodeboxes, especially if they have a fixed nodebox that is very small, like technic cabling, or xpanes. Tried it on fences and my xpane conversion, and happy with the result.
2016-03-12Nodebox: Allow nodeboxes to "connect"Auke Kok
We introduce a new nodebox type "connected", and allow these nodes to have optional nodeboxes that connect it to other connecting nodeboxes. This is all done at scenedraw time in the client. The client will inspect the surrounding nodes and if they are to be connected to, it will draw the appropriate connecting nodeboxes to make those connections. In the node_box definition, we have to specify separate nodeboxes for each valid connection. This allows us to make nodes that connect only horizontally (the common case) by providing optional nodeboxes for +x, -x, +z, -z directions. Or this allows us to make wires that can connect up and down, by providing nodeboxes that connect it up and down (+y, -y) as well. The optional nodeboxes can be arrays. They are named "connect_top, "connect_bottom", "connect_front", "connect_left", "connect_back" and "connect_right". Here, "front" means the south facing side of the node that has facedir = 0. Additionally, a "fixed" nodebox list present will always be drawn, so one can make a central post, for instance. This "fixed" nodebox can be omitted, or it can be an array of nodeboxes. Collision boxes are also updated in exactly the same fashion, which allows you to walk over the upper extremities of the individual node boxes, or stand really close to them. You can also walk up node noxes that are small in height, all as expected, and unlike the NDT_FENCELIKE nodes. I've posted a screenshot demonstrating the flexibility at http://i.imgur.com/zaJq8jo.png In the screenshot, all connecting nodes are of this new subtype. Transparent textures render incorrectly, Which I don't think is related to this text, as other nodeboxes also have issues with this. A protocol bump is performed in order to be able to send older clients a nodeblock that is usable for them. In order to avoid abuse of users we send older clients a "full-size" node, so that it's impossible for them to try and walk through a fence or wall that's created in this fashion. This was tested with a pre-bump client connected against a server running the new protocol. These nodes connect to other nodes, and you can select which ones those are by specifying node names (or group names) in the connects_to string array: connects_to = { "group:fence", "default:wood" } By default, nodes do not connect to anything, allowing you to create nodes that always have to be paired in order to connect. lua_api.txt is updated to reflect the extension to the node_box API. Example lua code needed to generate these nodes can be found here: https://gist.github.com/sofar/b381c8c192c8e53e6062
2015-10-02Mapnode: Replace rotateAlongYAxis with improved versionparamat
Get facedir by using lowest 5 bits of param2 and limiting to 23 More robust, frees up higher param2 bits for other uses Change lookup table and table index to u8
2015-09-22Mapnode: Add rotateAlongYAxisFull supporting 24 facedirsparamat
2015-08-25Change i++ to ++iDavid Jones
2015-05-03RotateAlongYAxis: For facedir case, return if param2 >= 4paramat
2015-04-01Move globals from main.cpp to more sane locationsCraig Robbins
Move debug streams to log.cpp|h Move GUI-related globals to clientlauncher Move g_settings and g_settings_path to settings.cpp|h Move g_menuclouds to clouds.cpp|h Move g_profiler to profiler.cpp|h
2015-03-07For usages of assert() that are meant to persist in Release builds (when ↵Craig Robbins
NDEBUG is defined), replace those usages with persistent alternatives
2015-02-23Optimise MapBlockMesh related functionsgregorycu
Directely or indirectly optimises the following functions: * MapBlockMesh::MapBlockMesh * MapBlockMesh::getTileInfo * MapBlockMesh::makeFastFace * MapBlockMesh::getSmoothLightCombined
2015-02-10Increase MapBlock::actuallyUpdateDayNightDiff() performance by 2-8x. ok ↵Craig Robbins
@celeron55 Before patch, function consumes up to ~8% of the main server loop. After, ~0% (below level of 2 places of significance)
2015-01-09Fix facedir > 23 causes segfault in clientCraig Robbins
See issue #2017 Applied kahrl's gist
2015-01-04Remove freezemelt (the remainder of proller nonsense)kwolekr
2014-12-10Increase performance of getLight() by at least 2xCraig Robbins
Leads to the following increases: getSmoothLight() approx. 40% increase getTileInfo() approx. 25% increase MapBlockMesh::MapBlockMesh() 25-30%
2014-11-21Optimise getTileInfo()Craig Robbins
getTileInfo() ~1.5x faster getSmoothLight ~2.0x faster
2014-10-19Custom collision boxes node property.RealBadAngel
2013-11-29Cavegen: Respect is_ground_content MapNode setting; fix some code formatting ↵kwolekr
issues
2013-07-28Better snow fall, finite liquid transform, leveled nodes apiproller
2013-07-27Weather supportproller
2013-07-13Leveled nodeboxproller
2013-07-08Fix wallmounted rotations along Y axis for 90 and 270 degree caseskwolekr