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
76 MCAPI ::SubChunk* _getAbsorption(
80 bool shouldCheckSkyLightInclusion
86 MCAPI ::SubChunk* _getBlock(
93 MCAPI
void _propagateBlockLight();
97 MCAPI
void _propagateSkyLight();
101 MCAPI
void _propagateSubtractiveBlockLight();
103 MCAPI
void _propagateSubtractiveBlockLight(
::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
105 MCAPI
void _propagateSubtractiveSkyLight(
bool shouldCheckForIgnoredAbsorptionValues);
107 MCAPI
void _propagateSubtractiveSkyLight(
::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
109 MCAPI
void _setLightHelper(
123 MCAPI
void _setSkyLight(
133 MCAPI ::Pos getCentralSubchunkOrigin();
135 MCAPI ::SubChunkBrightnessStorage::LightPair getLightPair(
::Pos const& coord)
const;
137 MCAPI ::SubChunkBrightnessStorage::LightPair getLightPairWithPlaceholderCheck(
142 MCAPI
void getTouchedSubChunks(::std::vector<::Pos>& subChunkPosList);
144 MCAPI
void relightSubChunk(
146 ::std::vector<::SubChunkLightUpdate>
const& alteredBlockList,
147 ::std::vector<::BlockPos>& brightnessChangedList
150 MCAPI
void setBlockLight(
158 MCAPI
void setSkyLight(
168 MCAPI ~SubChunkRelighter();
174 MCAPI
static void initializeStatics();
176 MCAPI
static void shutdownStatics();
182 MCAPI static ::std::bitset<196608>& mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
184 MCAPI static ::std::bitset<196608>& mOuterEdgeOfComputationBits();
186 MCAPI static ::SpinLockImpl& sDarkSpinLock();
188 MCAPI static ::std::unique_ptr<::SubChunk>& sFullyDarkSubChunk();
190 MCAPI static ::std::unique_ptr<::SubChunk>& sFullyLitSubChunk();
192 MCAPI static ::SpinLockImpl& sLitSpinLock();
200 uint64 centerSubChunkIndex,
203 bool originalLighting,
204 bool useFullyDarkSubchunk