X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fvoxel.cpp;h=981bc58233cb73a2c7686e824e89d12d6e9beda3;hb=b5f7249a7edc25077d84b27b38552228b92ff763;hp=02da42459ea3edbede63289d54cbe32402d7bba9;hpb=5d08ada2241569501fa22bfc5e5cde0ee7dfd0c7;p=oweals%2Fminetest.git diff --git a/src/voxel.cpp b/src/voxel.cpp index 02da42459..981bc5823 100644 --- a/src/voxel.cpp +++ b/src/voxel.cpp @@ -27,19 +27,13 @@ with this program; if not, write to the Free Software Foundation, Inc., /* Debug stuff */ -u32 addarea_time = 0; -u32 emerge_time = 0; -u32 emerge_load_time = 0; -u32 clearflag_time = 0; -//u32 getwaterpressure_time = 0; -//u32 spreadwaterpressure_time = 0; -u32 updateareawaterpressure_time = 0; -u32 flowwater_pre_time = 0; - - -VoxelManipulator::VoxelManipulator(): - m_data(NULL), - m_flags(NULL) +u64 addarea_time = 0; +u64 emerge_time = 0; +u64 emerge_load_time = 0; +u64 clearflag_time = 0; + + +VoxelManipulator::VoxelManipulator() { } @@ -53,15 +47,15 @@ void VoxelManipulator::clear() // Reset area to volume=0 m_area = VoxelArea(); delete[] m_data; - m_data = NULL; + m_data = nullptr; delete[] m_flags; - m_flags = NULL; + m_flags = nullptr; } void VoxelManipulator::print(std::ostream &o, INodeDefManager *ndef, VoxelPrintMode mode) { - v3s16 em = m_area.getExtent(); + const v3s16 &em = m_area.getExtent(); v3s16 of = m_area.MinEdge; o<<"size: "< 0) - unspreadLight(bank, unlighted_nodes, light_sources); -} -#endif - void VoxelManipulator::spreadLight(enum LightBank bank, v3s16 p, INodeDefManager *nodemgr) { @@ -596,34 +447,9 @@ void VoxelManipulator::spreadLight(enum LightBank bank, v3s16 p, } } -#if 0 -/* - Lights neighbors of from_nodes, collects all them and then - goes on recursively. - NOTE: This is faster on small areas but will overflow the - stack on large areas. Thus it is not used. -*/ -void VoxelManipulator::spreadLight(enum LightBank bank, - core::map & from_nodes) -{ - if(from_nodes.size() == 0) - return; - - core::map lighted_nodes; - core::map::Iterator j; - j = from_nodes.getIterator(); - - for(; j.atEnd() == false; j++) - { - v3s16 pos = j.getNode()->getKey(); - - spreadLight(bank, pos); - } -} -#endif +const MapNode VoxelManipulator::ContentIgnoreNode = MapNode(CONTENT_IGNORE); -#if 1 /* Lights neighbors of from_nodes, collects all them and then goes on recursively. @@ -716,6 +542,5 @@ void VoxelManipulator::spreadLight(enum LightBank bank, if(!lighted_nodes.empty()) spreadLight(bank, lighted_nodes, nodemgr); } -#endif //END