24class SubChunkRelighter {
27 enum class SubChunkToDoBitsClearMode :
int {
28 AllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits = 0,
29 SetOuterEdgeOfComputationBits = 1,
37 ::ll::TypedStorage<1, 1, bool> mNeedToResetToDoBits;
38 ::ll::TypedStorage<8, 24576, ::std::bitset<196608>> mToDo;
39 ::ll::TypedStorage<1, 4096, ::std::array<uchar, 4096>> mOldAbsorption;
40 ::ll::TypedStorage<8, 768, ::std::vector<::SubChunkLightIndex>[2][16]> mAdditiveBlocksToProcess;
41 ::ll::TypedStorage<8, 384, ::std::vector<::SubChunkLightIndex>[16]> mEdgeBlocksToProcess;
42 ::ll::TypedStorage<8, 384, ::std::vector<::SubChunkLightIndex>[16]> mBlocksToProcess;
43 ::ll::TypedStorage<8, 24, ::std::vector<::SubChunkLightIndex>> mAbsorptionBlocksToProcess;
44 ::ll::TypedStorage<8, 48, ::std::vector<::SubtractiveLightInfo>[2]> mSubtractiveBlocks;
45 ::ll::TypedStorage<8, 384, ::SubChunk* [3][4][4]> mSubChunkPtrArray;
46 ::ll::TypedStorage<1, 48, bool[3][4][4]> mSubChunkTouched;
47 ::ll::TypedStorage<8, 8, ::ChunkPos> mCenterChunkPos;
48 ::ll::TypedStorage<8, 8, uint64> mCenterSubChunkIndex;
49 ::ll::TypedStorage<1, 1, bool> mOriginalLighting;
50 ::ll::TypedStorage<1, 1, bool> mIsClientSide;
51 ::ll::TypedStorage<1, 1, ::SubChunkBrightnessStorage::LightPair> mDefaultLightPair;
61 MCAPI SubChunkRelighter(
63 uint64 centerSubChunkIndex,
66 bool originalLighting,
67 bool useFullyDarkSubchunk
79 MCAPI ::SubChunk* _getBlock(
86 MCAPI ::SubChunkBrightnessStorage::LightPair _getLightPair(
::SubChunkLightIndex coordIndex)
const;
88 MCAPI
void _propagateBlockLight();
92 MCAPI
void _propagateSkyLight();
96 MCAPI
void _propagateSubtractiveBlockLight();
98 MCAPI
void _propagateSubtractiveBlockLight(
::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
100 MCAPI
void _propagateSubtractiveSkyLight(
bool shouldCheckForIgnoredAbsorptionValues);
102 MCAPI
void _propagateSubtractiveSkyLight(
::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
104 MCAPI
void _setLightHelper(
118 MCAPI
void _setSkyLight(
126 MCAPI
void relightSubChunk(
128 ::std::vector<::SubChunkLightUpdate>
const& alteredBlockList,
129 ::std::vector<::BlockPos>& brightnessChangedList
132 MCAPI
void setBlockLight(
140 MCAPI ~SubChunkRelighter();
146 MCAPI static ::std::bitset<196608> computeAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
148 MCAPI static ::std::bitset<196608> computeOuterEdgeOfComputationBits();
150 MCAPI
static void initializeStatics();
156 MCAPI static ::std::bitset<196608>& mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
158 MCAPI static ::std::bitset<196608>& mOuterEdgeOfComputationBits();
160 MCAPI static ::SpinLockImpl& sDarkSpinLock();
162 MCAPI static ::std::unique_ptr<::SubChunk>& sFullyDarkSubChunk();
164 MCAPI static ::std::unique_ptr<::SubChunk>& sFullyLitSubChunk();
166 MCAPI static ::SpinLockImpl& sLitSpinLock();
174 uint64 centerSubChunkIndex,
177 bool originalLighting,
178 bool useFullyDarkSubchunk