aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_vmanip.cpp
Commit message (Collapse)AuthorAge
* Mapgen: Add propagate_shadow bool to calcLightingparamat2015-12-07
| | | | | | | | | | 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
* SAPI: Mark all Lua API functions requiring envlockkwolekr2015-10-25
|
* Add optional buffer param for bulk data array writes in Luakwolekr2015-05-17
|
* Switch to check_v3s16 in l_mapgen.cpp and l_vmanip.cpp for type safetykwolekr2015-04-17
|
* Shorten ManualMapVoxelManipulator to MMVManipkwolekr2015-01-05
|
* Optionally specify propagateSunlight area in calcLightingkwolekr2015-01-05
| | | | This fixes the Mapgen V5 calcLighting segfault
* Exclude vertical mapblock borders when setting lightkwolekr2015-01-04
|
* LuaVoxelManip: Error when given out-of-bounds areakwolekr2015-01-04
|
* Lighting: Fix nearly all issueskwolekr2015-01-04
| | | | | | | | | | | 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.
* LuaVoxelManip: Remove blank allocatorkwolekr2014-12-29
|
* LuaVoxelManip: Add option to allocate blank datakwolekr2014-12-27
|
* Add LuaVoxelManip methods: get_node_at() and set_node_at()kwolekr2014-09-01
|
* Update Mapgen VoxelManipulator on buffer invalidationkwolekr2014-09-01
|
* Fix issue 1527Craig Robbins2014-07-29
| | | | https://github.com/minetest/minetest/issues/1527
* Huge overhaul of the entire MapgenParams systemkwolekr2014-02-03
| | | | | | 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.
* LuaVoxelManip: Add get_param2_data and set_param2_datakwolekr2014-01-19
|
* LuaVoxelManip: Add area parameters back to calc_lighting and set_lighting, ↵kwolekr2013-11-30
| | | | made optional this time; also fixed a slight bug with night values being ignored
* LuaVoxelManip: Add get_light_data() and set_light_data()kwolekr2013-11-30
|
* LuaVoxelManip: Update parameter index of set_lighting()kwolekr2013-11-21
|
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
|
* LuaVoxelManip: Allow liquid updates in non-mapgen VoxelManip objectskwolekr2013-07-06
|
* LuaVoxelManip: Fix minor bug with set_lighting, remove coordinate params for ↵kwolekr2013-06-29
| | | | light and liquid updates
* Apply various fixes to several thingskwolekr2013-06-27
|
* LuaVoxelManip: Separate VoxelManip data get/set from emerging/blitting data ↵kwolekr2013-06-27
| | | | back to map
* Add minetest.get_mapgen_object to APIkwolekr2013-06-27
|
* Add LuaVoxelManipkwolekr2013-06-27
v3s16 p = i->first; NodeMetadata *data = i->second; u16 p16 = p.Z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + p.Y*MAP_BLOCKSIZE + p.X; writeU16(os, p16); data->serialize(os); } } void NodeMetadataList::deSerialize(std::istream &is, IGameDef *gamedef) { m_data.clear(); u8 version = readU8(is); if(version == 0){ // Nothing return; } if(version != 1){ infostream<<__FUNCTION_NAME<<": version "<<version<<" not supported" <<std::endl; throw SerializationError("NodeMetadataList::deSerialize"); } u16 count = readU16(is); for(u16 i=0; i<count; i++) { u16 p16 = readU16(is); v3s16 p(0,0,0); p.Z += p16 / MAP_BLOCKSIZE / MAP_BLOCKSIZE; p16 -= p.Z * MAP_BLOCKSIZE * MAP_BLOCKSIZE; p.Y += p16 / MAP_BLOCKSIZE; p16 -= p.Y * MAP_BLOCKSIZE; p.X += p16; if(m_data.find(p) != m_data.end()) { infostream<<"WARNING: NodeMetadataList::deSerialize(): " <<"already set data at position" <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring." <<std::endl; continue; } NodeMetadata *data = new NodeMetadata(gamedef); data->deSerialize(is); m_data[p] = data; } } NodeMetadataList::~NodeMetadataList() { clear(); } NodeMetadata* NodeMetadataList::get(v3s16 p) { std::map<v3s16, NodeMetadata*>::const_iterator n = m_data.find(p); if(n == m_data.end()) return NULL; return n->second; } void NodeMetadataList::remove(v3s16 p) { NodeMetadata *olddata = get(p); if(olddata) { delete olddata; m_data.erase(p); } } void NodeMetadataList::set(v3s16 p, NodeMetadata *d) { remove(p); m_data.insert(std::make_pair(p, d)); } void NodeMetadataList::clear() { for(std::map<v3s16, NodeMetadata*>::iterator i = m_data.begin(); i != m_data.end(); i++) { delete i->second; } m_data.clear(); }