summaryrefslogtreecommitdiffstats
path: root/src/BlockArea.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-04-29 15:41:24 +0200
committermadmaxoft <github@xoft.cz>2014-04-29 15:41:24 +0200
commit7e972f6a5ddb5b0cb7557044085bf1959ae7cb48 (patch)
treefdb6c9a01bfb52dd75d8d5d7afeaff304325615c /src/BlockArea.cpp
parentAdded BiomeToString() API function. (diff)
parentAdded BiomeToString() API function. (diff)
downloadcuberite-7e972f6a5ddb5b0cb7557044085bf1959ae7cb48.tar
cuberite-7e972f6a5ddb5b0cb7557044085bf1959ae7cb48.tar.gz
cuberite-7e972f6a5ddb5b0cb7557044085bf1959ae7cb48.tar.bz2
cuberite-7e972f6a5ddb5b0cb7557044085bf1959ae7cb48.tar.lz
cuberite-7e972f6a5ddb5b0cb7557044085bf1959ae7cb48.tar.xz
cuberite-7e972f6a5ddb5b0cb7557044085bf1959ae7cb48.tar.zst
cuberite-7e972f6a5ddb5b0cb7557044085bf1959ae7cb48.zip
Diffstat (limited to 'src/BlockArea.cpp')
-rw-r--r--src/BlockArea.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp
index f03fc6042..55e8d6849 100644
--- a/src/BlockArea.cpp
+++ b/src/BlockArea.cpp
@@ -13,11 +13,21 @@
-// This wild construct allows us to pass a function argument and still have it inlined by the compiler :)
-/// Merges two blocktypes and blockmetas of the specified sizes and offsets using the specified combinator function
+
+// Disable MSVC warnings: "conditional expression is constant"
+#ifdef _MSC_VER
+ #pragma warning(push)
+ #pragma warning(disable:4127)
+#endif
+
+
+
+
typedef void (CombinatorFunc)(BLOCKTYPE & a_DstType, BLOCKTYPE a_SrcType, NIBBLETYPE & a_DstMeta, NIBBLETYPE a_SrcMeta);
+// This wild construct allows us to pass a function argument and still have it inlined by the compiler :)
+/// Merges two blocktypes and blockmetas of the specified sizes and offsets using the specified combinator function
template<bool MetasValid, CombinatorFunc Combinator>
void InternalMergeBlocks(
BLOCKTYPE * a_DstTypes, const BLOCKTYPE * a_SrcTypes,
@@ -61,6 +71,8 @@ void InternalMergeBlocks(
+
+
/// Combinator used for cBlockArea::msOverwrite merging
template<bool MetaValid>
void MergeCombinatorOverwrite(BLOCKTYPE & a_DstType, BLOCKTYPE a_SrcType, NIBBLETYPE & a_DstMeta, NIBBLETYPE a_SrcMeta)
@@ -248,6 +260,11 @@ void MergeCombinatorMask(BLOCKTYPE & a_DstType, BLOCKTYPE a_SrcType, NIBBLETYPE
}
}
+// Re-enable previously disabled MSVC warnings
+#ifdef _MSC_VER
+ #pragma warning(pop)
+#endif
+