LocalPlayer::accelerateHorizontal: cleanups
[oweals/minetest.git] / src / voxel.cpp
index 08765c98e78b8216846352fee4b4a53c8f0f2a56..981bc58233cb73a2c7686e824e89d12d6e9beda3 100644 (file)
@@ -55,7 +55,7 @@ void VoxelManipulator::clear()
 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: "<<em.X<<"x"<<em.Y<<"x"<<em.Z
         <<" offset: ("<<of.X<<","<<of.Y<<","<<of.Z<<")"<<std::endl;
@@ -208,7 +208,7 @@ void VoxelManipulator::addArea(const VoxelArea &area)
 }
 
 void VoxelManipulator::copyFrom(MapNode *src, const VoxelArea& src_area,
-               v3s16 from_pos, v3s16 to_pos, v3s16 size)
+               v3s16 from_pos, v3s16 to_pos, const v3s16 &size)
 {
        /* The reason for this optimised code is that we're a member function
         * and the data type/layout of m_data is know to us: it's stored as
@@ -256,7 +256,7 @@ void VoxelManipulator::copyFrom(MapNode *src, const VoxelArea& src_area,
 }
 
 void VoxelManipulator::copyTo(MapNode *dst, const VoxelArea& dst_area,
-               v3s16 dst_pos, v3s16 from_pos, v3s16 size)
+               v3s16 dst_pos, v3s16 from_pos, const v3s16 &size)
 {
        for(s16 z=0; z<size.Z; z++)
        for(s16 y=0; y<size.Y; y++)
@@ -384,37 +384,6 @@ void VoxelManipulator::unspreadLight(enum LightBank bank, v3s16 p, u8 oldlight,
        }
 }
 
-/*
-       Goes recursively through the neighbours of the node.
-
-       Alters only transparent nodes.
-
-       If the lighting of the neighbour is lower than the lighting of
-       the node was (before changing it to 0 at the step before), the
-       lighting of the neighbour is set to 0 and then the same stuff
-       repeats for the neighbour.
-
-       The ending nodes of the routine are stored in light_sources.
-       This is useful when a light is removed. In such case, this
-       routine can be called for the light node and then again for
-       light_sources to re-light the area without the removed light.
-
-       values of from_nodes are lighting values.
-*/
-void VoxelManipulator::unspreadLight(enum LightBank bank,
-               std::map<v3s16, u8> & from_nodes,
-               std::set<v3s16> & light_sources, INodeDefManager *nodemgr)
-{
-       if(from_nodes.empty())
-               return;
-
-       for(std::map<v3s16, u8>::iterator j = from_nodes.begin();
-               j != from_nodes.end(); ++j)
-       {
-               unspreadLight(bank, j->first, j->second, light_sources, nodemgr);
-       }
-}
-
 void VoxelManipulator::spreadLight(enum LightBank bank, v3s16 p,
                INodeDefManager *nodemgr)
 {