diff options
author | STRWarrior <niels.breuker@hotmail.nl> | 2014-03-31 19:47:18 +0200 |
---|---|---|
committer | STRWarrior <niels.breuker@hotmail.nl> | 2014-03-31 19:47:18 +0200 |
commit | c4e07631c803debf1047a5607c96d9bf5c1e5f95 (patch) | |
tree | f7bf5fc909aa00986fda6942ecc2ba20aba8f286 /src | |
parent | Added all current NetherFort prefabs. (diff) | |
download | cuberite-c4e07631c803debf1047a5607c96d9bf5c1e5f95.tar cuberite-c4e07631c803debf1047a5607c96d9bf5c1e5f95.tar.gz cuberite-c4e07631c803debf1047a5607c96d9bf5c1e5f95.tar.bz2 cuberite-c4e07631c803debf1047a5607c96d9bf5c1e5f95.tar.lz cuberite-c4e07631c803debf1047a5607c96d9bf5c1e5f95.tar.xz cuberite-c4e07631c803debf1047a5607c96d9bf5c1e5f95.tar.zst cuberite-c4e07631c803debf1047a5607c96d9bf5c1e5f95.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/BlockArea.cpp | 34 | ||||
-rw-r--r-- | src/BlockArea.h | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 2b950378a..17d3cbb00 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; + } +} + + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cBlockArea: @@ -709,6 +728,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 default: { diff --git a/src/BlockArea.h b/src/BlockArea.h index d37f0d182..0bb272fd9 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -52,6 +52,7 @@ public: msImprint, msLake, msSpongePrint, + msDifference, } ; cBlockArea(void); |