Commit Graph

29 Commits

Author SHA1 Message Date
Dániel Juhász
ab371cc934 Light calculation: New bulk node lighting code
This commit introduces a new bulk node lighting algorithm to minimize
lighting bugs during l-system tree generation, schematic placement and
non-mapgen-object lua voxelmanip light calculation.

If the block above the changed area is not loaded, it gets loaded to avoid
lighting bugs.
Light is updated as soon as write_to_map is called on a voxel manipulator,
therefore update_map does nothing.
2017-03-11 02:06:18 +00:00
paramat
70e2df4f86 Lua voxelmanip: Add optional buffer param for 'get param2 data'
Update lua_api.txt.
2016-10-31 10:59:38 +00:00
kwolekr
3c63c3044d Add MapSettingsManager and new mapgen setting script API functions
This commit refactors the majority of the Mapgen settings system.
- MapgenParams is now owned by MapSettingsManager, itself a part of ServerMap,
  instead of the EmergeManager.
- New Script API functions added:
    core.get_mapgen_setting
    core.get_mapgen_setting_noiseparams,
    core.set_mapgen_setting, and
    core.set_mapgen_setting_noiseparams.
- minetest.get/set_mapgen_params are deprecated by the above new functions.
- It is now possible to view and modify any arbitrary mapgen setting from a mod,
  rather than the base MapgenParams structure.
- MapgenSpecificParams has been removed.
2016-07-03 15:38:36 -04:00
paramat
49073ba2c3 Mapgen: Add propagate_shadow bool to calcLighting
To terminate unwanted shadows from floatlands or realms above
Also add to LuaVoxelManip calc_lighting for use in mapgen mods
Remove the 2 argument calcLighting, mapgens now use the 5
argument form to specify the volumes for propagateSunlight and
spreadLight
In mgsinglenode replace calcLighting with setLighting and
clean-up use of tabs and spaces
2015-12-07 03:18:24 +00:00
kwolekr
54f1267c2c SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
kwolekr
3ffb5f5761 Add optional buffer param for bulk data array writes in Lua 2015-05-17 00:07:45 -04:00
kwolekr
3576f4fab7 Switch to check_v3s16 in l_mapgen.cpp and l_vmanip.cpp for type safety 2015-04-17 01:03:13 -04:00
kwolekr
2d849b0a19 Shorten ManualMapVoxelManipulator to MMVManip 2015-01-05 02:42:27 -05:00
kwolekr
7289d61e99 Optionally specify propagateSunlight area in calcLighting
This fixes the Mapgen V5 calcLighting segfault
2015-01-05 01:20:36 -05:00
kwolekr
3bdf3df223 Exclude vertical mapblock borders when setting light 2015-01-04 23:14:16 -05:00
kwolekr
ef8ed5d127 LuaVoxelManip: Error when given out-of-bounds area 2015-01-04 03:07:28 -05:00
kwolekr
7233a1228e Lighting: Fix nearly all issues
The cause of a single light source seemingly being lit without spread
was due to its creation in the +Y mapblock boundary layer during map
generation, which was ignored as the overtop.  This overtop explicitly
needs to be omitted during sunlight propagation, however.  To accomplish
this, Mapgen::calcLighting() was split into separate functions taking
separate parameters.
Additionally, do not diminish light too early during spread.  This fixes the
output inconsistency between Map::updateLighting and Mapgen::calcLighting.
2015-01-04 02:42:31 -05:00
kwolekr
cc3ab5efa5 LuaVoxelManip: Remove blank allocator 2014-12-29 01:31:37 -05:00
kwolekr
8334100fe1 LuaVoxelManip: Add option to allocate blank data 2014-12-27 23:09:36 -05:00
kwolekr
f3eefeb794 Add LuaVoxelManip methods: get_node_at() and set_node_at() 2014-09-01 17:33:21 -04:00
kwolekr
9e4e7072da Update Mapgen VoxelManipulator on buffer invalidation 2014-09-01 15:12:22 -04:00
Craig Robbins
6929206bc2 Fix issue 1527
https://github.com/minetest/minetest/issues/1527
2014-07-29 22:39:39 -04:00
kwolekr
5a34f40d80 Huge overhaul of the entire MapgenParams system
MapgenParams is no longer a polymorphic class, eliminating the need for messy and bug-prone reallocations.
Separation between the common and mapgen-specific parameters is now strongly defined.
Mapgen parameters objects are now properly encapsulated within the proper subsystems.
2014-02-03 22:50:14 -05:00
kwolekr
bafc4ac6a1 LuaVoxelManip: Add get_param2_data and set_param2_data 2014-01-19 02:55:59 -05:00
kwolekr
ff7d7080e3 LuaVoxelManip: Add area parameters back to calc_lighting and set_lighting, made optional this time; also fixed a slight bug with night values being ignored 2013-11-30 00:27:39 -05:00
kwolekr
769b2d7c05 LuaVoxelManip: Add get_light_data() and set_light_data() 2013-11-30 00:01:43 -05:00
kwolekr
98e4e2b373 LuaVoxelManip: Update parameter index of set_lighting() 2013-11-21 00:45:17 -05:00
Kahrl
4e1f50035e Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
kwolekr
06266abd6e LuaVoxelManip: Allow liquid updates in non-mapgen VoxelManip objects 2013-07-06 15:12:40 -04:00
kwolekr
067888d549 LuaVoxelManip: Fix minor bug with set_lighting, remove coordinate params for light and liquid updates 2013-06-29 22:23:00 -04:00
kwolekr
9e100bc42b Apply various fixes to several things 2013-06-27 22:35:35 -04:00
kwolekr
6b3169e4d0 LuaVoxelManip: Separate VoxelManip data get/set from emerging/blitting data back to map 2013-06-27 22:35:35 -04:00
kwolekr
8aa930f28e Add minetest.get_mapgen_object to API 2013-06-27 22:35:35 -04:00
kwolekr
d6ac3d8d9a Add LuaVoxelManip 2013-06-27 22:35:35 -04:00