aboutsummaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
AgeCommit message (Collapse)Author
2016-05-23Move updateTextures and fillTileAttribs to ContentFeaturesEkdohibs
2016-03-14Connected nodes: fix 2 minor bugsAuke Kok
1. Copy-paste error: properly test for back-connection. In the case of two different connected nodebox types, we want to assure that if A connects to B, that B also connects to A. This test was accidentally not implemented correctly. 2. Clear the connects_to_ids before deserializing. With each new connected node, the deserialization code added more and more targets to the map, since the map wasn't cleared in between deserialization steps. This caused e.g. wall blocks to connect to things in the fence connects_to map.
2016-03-12Allow nodes to specify which sides to connect to.Auke Kok
NDT_CONNECTED attempts to connect to any side of nodes that it can connect to, which is troublesome for FACEDIR type nodes that generally may only have one usable face, and can be rotated. We introduce a node parameter `connect_sides` that is valid for any node type. If specified, it lists faces of the node (in "top", "bottom", "front", "left", "back", "right", form, as array) that connecting nodeboxes can connect to. "front" corresponds to the south facing side of a node with facedir = 0. If the node is rotatable using *simple* FACEDIR, then the attached face is properly rotated before checking. This allows e.g. a chest to be attached to only from the rear side.
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
2016-03-07Add minetest.register_lbm() to run code on block load onlyest31
2016-02-27Nodedef: Restore smooth lighting to waterparamat
2016-02-26Remove new_style_waterRealBadAngel
2016-02-10Fix backface culling when connecting to new servers.Auke Kok
Introduce a new contentfeatures version (8). When clients connect using v27 protocol version, they can assume that the tiledef.backface_culling is trustable, but if clients connect to servers providing contentfeatures version 7, then the v27 clients know that backface culling settings provided by the server in tiledefs are bogus for mesh, plantlike, firelike or liquid drawtype nodes. thanks to hmmmm, est31, nerzhul. Tested on new client - new server, new client - old server old client - new server.
2016-02-08Cleanup selection mesh code, add shaders for halo and selection boxesRealBadAngel
2016-01-23Backface culling: Ignore setting in tiledef from old servers.Auke Kok
Outdated servers are always sending tiledefs with culling enabled no matter what, as the value was previously entirely ignored. To compensate, we must (1) detect that we're running against an old server with a new client, and (2) disable culling for mesh, plantlike, firelike and liquid draw types no matter what the server is telling us. In order to achieve this, we need to bump the protocol version since we cannot rely on the tiledef version, and test for it being older. I've bumped the protocol version, although that should have likely happened in the actual change that introduced the new backface_culling PR #3578. Fortunately that's only 2 commits back at this point. We also explicitly test for the drawtype to assure we are not changing the culling value for other nodes, where it should remain enabled. This was tested against various pub servers, including 0.4.13 and 0.4.12. Fixes #3598
2016-01-20Allow per-tiles culling.Auke Kok
Backface culling is enabled by default for all tiles, as this is how the lua parser initializes each tiledef. We revert to always using the value from the tiledef since it is always read and serialized. Mods that wish to enable culling for e.g. mesh nodes, now can specify the following to enable backface culling: tiles = {{ name = "tex.png", backface_culling = true }}, Note the double '{' and use of 'name' key here! In the same fashion, backface_culling can be disabled for any node now. I've tested this against the new door models and this properly allows me to disable culling per node. I've also tested this against my crops mod which uses mesh nodes where culling needs to be disabled, and tested also with plantlike drawtype nodes where we want this to continue to be disabled. No default setting has changed. The defaults are just migrated from nodedef.cpp to c_content.cpp.
2016-01-07Liquids: Flow into and destroy 'floodable' nodesparamat
Add new node property 'floodable', default false Define "air" as floodable = true in C++ and lua
2015-10-14Use warningstream for log messages with WARNINGShadowNinja
Remove DTIME macro and its uses, too
2015-08-25Change i++ to ++iDavid Jones
2015-08-20Remove use of engine sent texture tiling flags - theyre no longer neededRealBadAngel
2015-08-05Fix tiling issues for PLANTLIKE and FIRELIKE with FSAARealBadAngel
2015-07-21Add wielded (and CAOs) shaderRealBadAngel
2015-07-16Fix relief mapping issuesRealBadAngel
2015-07-08Add new leaves style - simple (glasslike drawtype)RealBadAngel
2015-06-28Minimap updateRealBadAngel
2015-06-27Add minimap featureRealBadAngel
2015-05-19Add texture overridingrubenwardy
2015-05-07NodeResolver: Remove NodeResolveMethodkwolekr
This simplifies NodeResolver logic and makes some interfaces cleaner.
2015-05-05NodeDefManager: Improve const-correctness of interfaceskwolekr
- Add ability to explicitly reset NodeResolve state (useful for unittesting) - Remove non-essential NodeResolve methods modifying state from INodeDefManager - Add const qualifier to NodeDefManager and ContentFeatures serialize
2015-05-05Tests: Add NodeResolver unittestskwolekr
Minor misc. NodeResolver cleanups Prefix faux content type constants for testing with t_ to avoid confusion or name collisions
2015-04-16Schematics: Refactor NodeResolver and add NodeResolveMethodkwolekr
NodeResolver name lists now belong to the NodeResolver object instead of the associated NodeDefManager. In addition to minimizing unnecessary abstraction and overhead, this move permits NodeResolvers to look up nodes that they had previously set pending for resolution. So far, this functionality has been used in the case of schematics for serialization/deserialization.
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-31Move texture_min_size even further down the pipe. Now, textures are ↵Aaron Suen
JIT-upscaled using an image transformation, right at the time they're added to a mesh or particle; images used in 2D elements are left unscaled. This should fix any remaining issues with HUD elements.
2015-03-20Revert "Fix issue #2441: crash on respawn, since a conversion std::list to ↵kwolekr
std::vector on Environment.cpp" This reverts parts of commit 9749d9fee6db99da1ab861dc04ec63ef973db3e0, which breaks node resolver list clearing
2015-03-15Finer progress bar updates when initializing nodesest31
The bar is only drawn when the user will notice a change, which prevents time overheads that this commit would cause, resulting from useless draws.
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-03-05Fix issue #2441: crash on respawn, since a conversion std::list to ↵Loic Blot
std::vector on Environment.cpp * Also change some std::list to std::vector for ClientMap::renderMap * Remove disabled code in ClientMap::renderMap, disabled since a long time
2015-03-05Replace std::list to std::vector into tile.cpp (m_texture_trash) and move ↵Loic Blot
tile.hpp to src/client/
2015-01-04NodeDef: Clear NodeResolver related entries too in clear()kwolekr
2015-01-04NodeResolver: Perform callback immediately if node registration phase finishedkwolekr
Also add NodeResolver callbacks on the client
2015-01-04Remove freezemelt (the remainder of proller nonsense)kwolekr
2014-12-29Add support back for resolving group names in NodeResolverkwolekr
2014-12-27Set fallback content if resolving content vector requires everythingkwolekr
2014-12-27Redefine NodeResolver interface and replace with callback mechanismkwolekr
2014-12-21Change TileSpec::frames to be std::vector not std::mapunknown
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-12-12Use std::string::empty() instead of size() where applicableAnton
2014-12-12NodeResolver: Fix some comments and use const references for paramskwolekr
2014-12-11NodeResolver: Fix cancelNode and cancelNodeListkwolekr
2014-12-05Recalculate normals for mesh #0. Fix for issue #1902.RealBadAngel
2014-11-21Optimise functions from CNodeDefManager and VoxelManipulatorCraig Robbins
CNodeDefManager::get() VoxelManipulator::addArea()
2014-11-19Fix wallmounted mesh rotationsShadowNinja
2014-10-29Add option to enable mesh caching, add wallmounted for meshes.RealBadAngel
2014-10-28Add NodeResolver documentationkwolekr
Set content to fallback on AddNode failure Consider node list requests with no results as failed
2014-10-26Add NodeResolver and clean up node name -> content ID resolution systemkwolekr
2014-10-21Recalculate normals for cached meshes.RealBadAngel
Check if mesh is here before adding to meshcollector. Fix deleting the meshes.