summaryrefslogtreecommitdiff
path: root/src/content_mapblock.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-03-29 13:34:57 +0200
committerGitHub <noreply@github.com>2017-03-29 13:34:57 +0200
commitb605b95749aad90b53e6c58a1ee43b50f8217e7c (patch)
treef036a6d80ea539aad95e55443720b97b74668a9b /src/content_mapblock.cpp
parent5e806690fc5e0067247bbc1e541ba03b83fb761b (diff)
downloadminetest-b605b95749aad90b53e6c58a1ee43b50f8217e7c.tar.gz
minetest-b605b95749aad90b53e6c58a1ee43b50f8217e7c.tar.bz2
minetest-b605b95749aad90b53e6c58a1ee43b50f8217e7c.zip
Add CPP11 header to define nullptr & constexpr (#5471)
This header permit to use nullptr & constexpr keywords in portable code segments and benefit from nullptr & constexpr when using C++11 and greater
Diffstat (limited to 'src/content_mapblock.cpp')
-rw-r--r--src/content_mapblock.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index 18b4ef6dd..d0cb50db3 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "client.h"
#include "log.h"
#include "noise.h"
+#include "util/cpp11.h"
// Distance of light extrapolation (for oversized nodes)
// After this distance, it gives up and considers light level constant
@@ -42,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
// Corresponding offsets are listed in g_27dirs
#define FRAMED_NEIGHBOR_COUNT 18
-static const v3s16 light_dirs[8] = {
+static constexpr v3s16 light_dirs[8] = {
v3s16(-1, -1, -1),
v3s16(-1, -1, 1),
v3s16(-1, 1, -1),
@@ -54,7 +55,7 @@ static const v3s16 light_dirs[8] = {
};
// Standard index set to make a quad on 4 vertices
-static const u16 quad_indices[] = {0, 1, 2, 2, 3, 0};
+static constexpr u16 quad_indices[] = {0, 1, 2, 2, 3, 0};
const std::string MapblockMeshGenerator::raillike_groupname = "connect_to_raillike";