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(
87 MCAPI
void _propagateBlockLight();
89 MCAPI
void _propagateSkyLight();
91 MCAPI
void _propagateSubtractiveBlockLight();
93 MCAPI
void _propagateSubtractiveSkyLight(
bool shouldCheckForIgnoredAbsorptionValues);
96 MCAPI
void _setLightHelper(
110 MCAPI
void _setSkyLight(
118 MCAPI ::SubChunkBrightnessStorage::LightPair getLightPair(
::Pos const& coord)
const;
120 MCAPI ::SubChunkBrightnessStorage::LightPair getLightPairWithPlaceholderCheck(
126 MCAPI
void relightSubChunk(
128 ::std::vector<::SubChunkLightUpdate>
const& alteredBlockList,
129 ::std::vector<::BlockPos>& brightnessChangedList
135 MCAPI ~SubChunkRelighter();
141 MCAPI
static void initializeStatics();
143 MCAPI
static void shutdownStatics();
149 MCAPI static ::std::bitset<196608>& mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
151 MCAPI static ::std::bitset<196608>& mOuterEdgeOfComputationBits();
153 MCAPI static ::SpinLockImpl& sDarkSpinLock();
155 MCAPI static ::std::unique_ptr<::SubChunk>& sFullyDarkSubChunk();
157 MCAPI static ::std::unique_ptr<::SubChunk>& sFullyLitSubChunk();
159 MCAPI static ::SpinLockImpl& sLitSpinLock();
167 uint64 centerSubChunkIndex,
170 bool originalLighting,
171 bool useFullyDarkSubchunk