summaryrefslogtreecommitdiff
path: root/src/voxel.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-20 13:30:50 +0200
committerGitHub <noreply@github.com>2017-08-20 13:30:50 +0200
commit1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3 (patch)
tree03dd0c39e323c7f0b1f06014ff30e74f429bfa01 /src/voxel.h
parent50669cd2822a11570ae462972194eeb2d585a8c1 (diff)
downloadminetest-1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3.tar.gz
minetest-1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3.tar.bz2
minetest-1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3.zip
Modernize source code: last part (#6285)
* Modernize source code: last par * Use empty when needed * Use emplace_back instead of push_back when needed * For range-based loops * Initializers fixes * constructors, destructors default * c++ C stl includes
Diffstat (limited to 'src/voxel.h')
-rw-r--r--src/voxel.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/voxel.h b/src/voxel.h
index 49a75c95f..d03cecd95 100644
--- a/src/voxel.h
+++ b/src/voxel.h
@@ -59,7 +59,7 @@ class VoxelArea
{
public:
// Starts as zero sized
- VoxelArea() {}
+ VoxelArea() = default;
VoxelArea(const v3s16 &min_edge, const v3s16 &max_edge):
MinEdge(min_edge),
@@ -175,12 +175,12 @@ public:
VoxelArea operator+(const v3s16 &off) const
{
- return VoxelArea(MinEdge+off, MaxEdge+off);
+ return {MinEdge+off, MaxEdge+off};
}
VoxelArea operator-(const v3s16 &off) const
{
- return VoxelArea(MinEdge-off, MaxEdge-off);
+ return {MinEdge-off, MaxEdge-off};
}
/*
@@ -344,7 +344,7 @@ enum VoxelPrintMode
class VoxelManipulator
{
public:
- VoxelManipulator();
+ VoxelManipulator() = default;
virtual ~VoxelManipulator();
/*
@@ -374,7 +374,7 @@ public:
addArea(voxel_area);
if (m_flags[m_area.index(p)] & VOXELFLAG_NO_DATA) {
- return MapNode(CONTENT_IGNORE);
+ return {CONTENT_IGNORE};
}
return m_data[m_area.index(p)];
@@ -382,9 +382,9 @@ public:
MapNode getNodeNoExNoEmerge(const v3s16 &p)
{
if (!m_area.contains(p))
- return MapNode(CONTENT_IGNORE);
+ return {CONTENT_IGNORE};
if (m_flags[m_area.index(p)] & VOXELFLAG_NO_DATA)
- return MapNode(CONTENT_IGNORE);
+ return {CONTENT_IGNORE};
return m_data[m_area.index(p)];
}
// Stuff explodes if non-emerged area is touched with this.