summaryrefslogtreecommitdiffstats
path: root/src/BlockArea.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-04-01 21:21:11 +0200
committermadmaxoft <github@xoft.cz>2014-04-01 21:21:11 +0200
commite7e65b5005a39cd371230f7d6a4dac595cdc66a8 (patch)
tree3127513d415fafeba13e0b238bae9d499ca75acc /src/BlockArea.cpp
parentcBlockArea: Added the msMask merge strategy. (diff)
parentAPIDump: Gave msDifference it's own table. (diff)
downloadcuberite-e7e65b5005a39cd371230f7d6a4dac595cdc66a8.tar
cuberite-e7e65b5005a39cd371230f7d6a4dac595cdc66a8.tar.gz
cuberite-e7e65b5005a39cd371230f7d6a4dac595cdc66a8.tar.bz2
cuberite-e7e65b5005a39cd371230f7d6a4dac595cdc66a8.tar.lz
cuberite-e7e65b5005a39cd371230f7d6a4dac595cdc66a8.tar.xz
cuberite-e7e65b5005a39cd371230f7d6a4dac595cdc66a8.tar.zst
cuberite-e7e65b5005a39cd371230f7d6a4dac595cdc66a8.zip
Diffstat (limited to 'src/BlockArea.cpp')
-rw-r--r--src/BlockArea.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp
index 543dbe04d..60e4f11e5 100644
--- a/src/BlockArea.cpp
+++ b/src/BlockArea.cpp
@@ -173,6 +173,25 @@ static inline void MergeCombinatorSpongePrint(BLOCKTYPE & a_DstType, BLOCKTYPE a
+/** Combinator used for cBlockArea::msDifference merging */
+static inline void MergeCombinatorDifference(BLOCKTYPE & a_DstType, BLOCKTYPE a_SrcType, NIBBLETYPE & a_DstMeta, NIBBLETYPE a_SrcMeta)
+{
+ if ((a_DstType == a_SrcType) && (a_DstMeta == a_SrcMeta))
+ {
+ a_DstType = E_BLOCK_AIR;
+ a_DstMeta = 0;
+ }
+ else
+ {
+ a_DstType = a_SrcType;
+ a_DstMeta = a_SrcMeta;
+ }
+}
+
+
+
+
+
/** Combinator used for cBlockArea::msMask merging */
static inline void MergeCombinatorMask(BLOCKTYPE & a_DstType, BLOCKTYPE a_SrcType, NIBBLETYPE & a_DstMeta, NIBBLETYPE a_SrcMeta)
{
@@ -724,6 +743,21 @@ void cBlockArea::Merge(const cBlockArea & a_Src, int a_RelX, int a_RelY, int a_R
);
break;
} // case msSpongePrint
+
+ case msDifference:
+ {
+ InternalMergeBlocks(
+ m_BlockTypes, a_Src.GetBlockTypes(),
+ DstMetas, SrcMetas,
+ SizeX, SizeY, SizeZ,
+ SrcOffX, SrcOffY, SrcOffZ,
+ DstOffX, DstOffY, DstOffZ,
+ a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(),
+ m_Size.x, m_Size.y, m_Size.z,
+ MergeCombinatorDifference
+ );
+ break;
+ } // case msDifference
case msMask:
{