aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-05-02Fix Windows buildCraig Robbins
Fixes the issue introduced by c1a0ebb (Fix use of uninitialised variable in class Event) causing Windows builds to fail
2016-05-01FileSelectMenu: Fix formspec parsing broken by Irrlicht file-chooserKahrl
2016-05-01find_path: consider walkable instead of CONTENT_AIRAuke Kok
The path finding code works fairly well except that it considers anythin not CONTENT_AIR to be "above the surface". This results in paths that are unwalkable for entities since e.g. plants are not walkable. The path would force them to jump on top of grass plants, etc.. The obvious solution is not to use CONTENT_AIR as a criteria, but instead distinguish between walkable and non-walkable nodes. This results in paths that properly walk through grass nodes. This was extensively tested by a flock of electric sheep. Note that for underwater purposes this changes the behaviour from "the surface is walkable" to "ignore water entirely" making the path go across the water bottom, and pathing fail likely from the water surface. This is intentional.
2016-05-01Pathfinder: improve GridNode storageest31
Before, the GridNodes were stored in vector<vector<vector<T>>>, and initialized in advance. Putting three vectors inside each other puts lots of unneccessary stress onto the allocator, costs more memory, and has worse cache locality than a flat vector<T>. For larger search distances, an the array getting initialized means essentially O(distance^3) complexity in both time and memory, which makes the current path search a joke. In order to really profit from the dijkstra/A* algorithms, other data structures need to be used for larger distances. For shorter distances, a map based GridNode storage may be slow as it requires lots of levels of indirection, which is bad for things like cache locality, and an array based storage may be faster. This commit does: 1. remove the vector<vector<vector<T>>> based GridNodes storage that is allocated and initialized in advance and for the whole possible area. 2. Add a vector<T> based GridNodes storage that is allocated and initialized in advance for the whole possible area. 3. Add a map<P,T> based GridNodes storage whose elements are allocated and initialized, when the path search code demands it. 4. Add code to decide between approach 2 and 3, based on the length of the path. 5. Remove the unused "surfaces" member of the PathGridnode class. Setting this isn't as easy anymore for the map based GridNodes storage.
2016-05-01Pathfinder: use core::aabbox3d instead of own typeest31
There is no need to reinvent the wheel here, we have great classes from irrlicht.
2016-05-01Pathfinder: Fix styleest31
* Fix naming style for methods and classes: Use camelCase for methods and PascalCase for classes as code style demands it. And use sneak_case for methods that are not member of a class. * Replace "* " with " *" for Pointers * Same for references * Put function body opening braces on new line * Other misc minor non functional style improvements
2016-05-01Move pathfinder classes to cpp fileest31
There is no need to put them into the header, they are solely used inside the pathfinder. Another advantage of this change is that only the pathfinder.cpp has to be compiled if PATHFINDER_DEBUG gets defined or undefined, not all files including the .h. This commit moves the pathfinder classes to the cpp file without modifications. Also, the PATHFINDER_DEBUG macro gets moved to the cpp file and the PATHFINDER_CALC_TIME macro gets moved to a plce where it actually does work.
2016-05-01Fix use of uninitialised variable in class EventCraig Robbins
2016-05-01Use MoveFileEx to rename files on Windows (not rename)gregorycu
2016-04-30Fix POSIX C++11 buildShadowNinja
I broke this in 46fd114e9a4e05b74576dce682e24357363298e7.
2016-04-30Fix prepreprocessor error in thread.h (related to C++11 threads)Craig Robbins
2016-04-28Mapgen: Make 3D noise tunnels' width settableparamat
Correct parameter names mg_valleys to mgvalleys Remove biome NoiseParams from MapgenValleysParams Improve format of parameter code
2016-04-28Fix race on thread creationShadowNinja
This often broke the threading tests on OSX.
2016-04-28Mainmenu: Standardize the menu button order and sizesSmallJoker
2016-04-28Handle particle spawners in env and delete expired idsobneq
Rebased by Zeno (2016-04-2016)
2016-04-26Inventory: Make ItemStack with different metadata not stackableXunto
2016-04-25tile.cpp: Automatically upscale lower resolution textureSmallJoker
2016-04-24Make GUIEngine use pause_fps_max not fps_maxgregorycu
2016-04-24Escape more strings: formspecs, item descriptions, infotexts...Ekdohibs
Also, change the escape character to the more standard \x1b Thus, it can be used in the future for translation or colored text, for example.
2016-04-23Fix bug that was leading to oversized tooltips containing multiline text ↵Xunto
when it have multiple lines
2016-04-21Make logging use a fixed-length buffer to avoid race conditions.Ekdohibs
Previously, race conditions occurred inside logging, that caused segfaults because a thread was trying to use an old pointer that was freed when the string was reallocated. Using a fixed-length buffer avoids this, at the cost of cutting too long messages over seveal lines.
2016-04-21Biomes: Make dust fallback 'ignore' to fix y = 63 lightingparamat
The shadow bug at y = 63 was caused by dark air being placed as dust, when the biome dust was unspecified it was falling back to 'air' In dustTopNodes only dust == 'ignore' will disable dust placement
2016-04-20Mgv7: Combine mountain terrain generation with base terrain generationparamat
Previous mountain terrain generation was by necessity placing stone in air, this was removing air from any overgenerated structures such as tunnels, dungeons and large caves Moving it into the base terrain generation loop ensures that only 'ignore' is replaced generateRidgeTerrain: only return if node_max.Y < water_level - 16 Previously, if water level was set a few nodes above a mapchunk border the river channel was only partially excavated
2016-04-14Add option to disable entity selectionboxes. (#3992)TriBlade9
Setting only loaded once, default value is to enable them.
2016-04-12Fix inventory hud scalingrubenwardy
2016-04-12Mgv7, mgflat, mgfractal: Tunnel generation code optimisationparamat
2016-04-12Mgv5: Optimise tunnels, add biome material in entrancesparamat
Place biome top node on tunnel entrance floor Instead of doing nothing at node_max.Y + 1 use 1-down overgeneration for tunnel generation and noisemaps
2016-04-12Mgvalleys: Don't let cavegen place biome nodes everywhereparamat
Fix use of 'air_above' bool so that biome nodes are only placed in tunnel floors Minor code improvements 'Continue' when massive cave air is placed
2016-04-11Fix hotbar placement on displays with low screen densityPilzAdam
2016-04-10Hud: Cache hud_scaling, fix minor style issueskwolekr
2016-04-10Hud: Fix offset being ignored by inventory barrubenwardy
2016-04-10Update CSRP-GMP to commit deaa11a7c29a73008est31
Backports 10 commits, with 8 commits actually affecting source code: https://github.com/est31/csrp-gmp/compare/695822e45d9ca48b75b4ec1af1b4eea19139f8b1...deaa11a7c29a730087380da231e785909ad21630
2016-04-08Mapgen: Optimise cave noises and tunnel excavationparamat
Instead of doing nothing at node_max.Y + 1 use 1-down overgeneration for tunnel generation and noisemaps Move some old unused code in mgv7 to end of file
2016-04-07Re-add and disable blit_with_interpolate_overlaykwolekr
2016-04-06Fix #3955 (player dying on login).Nathanaël Courant
It was caused by player not moving because fall was prevented, but their velocity still increasing, causing fatal fall damage when world was finally loaded. This commit fixes it by setting player velocity to zero when the world around them is not loaded.
2016-04-06Fix compiler warnings from "Add an option to colorize to respect the ↵Samuel Sieb
destination alpha" Fix warnings added by commit 01ae43c48009f816f4649fae2f7f6997452aa6cf Fixes #3952
2016-04-03Add an option to colorize to respect the destination alphaSamuel Sieb
Also, rework the colorizing code to be more efficient.
2016-04-03Dungeongen: Update disabled torch placement codekinokoio
2016-04-02Fix nametag hidingest31
Commit c3b279750ece0b5144bf8e973d55108347462223 "Move object nametags to camera" has added a regression to still display a shadow if their alpha got set to 0.
2016-03-30Remove expensive copy of ContentFeaturesgregorycu
2016-03-30ParticleManager::handleParticleEvent: use switchLoic Blot
Use a proper switch with breaks.
2016-03-30mg_schematic: fix leak in lua API, and small cleanupest31
* Fix leak like behaviour if you load multiple schematics in a loop. * Cleanup check in for, fixing theoretical out of bounds read if Schematic::deserializeFromMts reduced the number of elements in m_nodenames. A != check may need an overflow of the counter before it hits, if origsize is larger than m_nodenames.size(). * Fix function name passed to errorstream: it was wrong. Also use __FUNCTION__ instead of manually using the method name at other places in the function. * Don't shadow the name member in the loop.
2016-03-30Mapgen: Don't spread light of nodes outside the desired areakwolekr
This fixes #3935, a regression from 0338c2e. An 'optimization' was performed where an index for the VoxelManip being operated on was mistakenly used for bounds checking within the incorrect VoxelArea, namely, the area wherein light should be spread.
2016-03-30Mgv7: Decrease cliff steepnessparamat
2016-03-29Mapgen: Spread both night and day light banks in spreadLightkwolekr
2016-03-29Fix small formatting issue in SRP debug outputsfan5
Writing an u8 to verbosestream writes a char, not it's numeric value.
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-21Mgv7/flat/fractal: Stop tunnel-floor biome nodes being placed everywhereparamat
A bool for 'in or under tunnel' was missing 1-node-deep stone ledges were being replaced with biome surface material
2016-03-19Clean up StrfndShadowNinja
Changes: * Fix indentation. * Pass strings by const reference. * Merge Strfnd and WStrfnd into one class instead of copying them. * Remove trailing spaces. * Fix variable names. * Move to util. * Other miscellaneous style fixes.
2016-03-19Mgv7: Limit pseudorandom caves to surface mapchunk or belowparamat
To avoid bright caves at mapchunk borders when generating mapchunks upwards