LeviLamina
Loading...
Searching...
No Matches
SubChunkRelighter.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/level/ChunkPos.h"
7#include "mc/world/level/chunk/SubChunkBrightnessStorage.h"
8
9// auto generated forward declare list
10// clang-format off
11class Block;
12class BlockPos;
13class IBlockSource;
14class LevelChunk;
15class Pos;
16class SpinLockImpl;
17struct Brightness;
18struct SubChunk;
22// clang-format on
23
25public:
26 // SubChunkRelighter inner types define
27 enum class SubChunkToDoBitsClearMode : int {
28 AllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits = 0,
29 SetOuterEdgeOfComputationBits = 1,
30 };
31
33
34public:
35 // member variables
36 // NOLINTBEGIN
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;
52 // NOLINTEND
53
54public:
55 // prevent constructor by default
57
58public:
59 // member functions
60 // NOLINTBEGIN
62 ::IBlockSource& source,
63 uint64 centerSubChunkIndex,
64 ::ChunkPos const& centerChunkPos,
65 bool isClientSide,
66 bool originalLighting,
67 bool useFullyDarkSubchunk
68 );
69
71
73
74 MCNAPI ::SubChunk* _dirtySubChunk(::SubChunkLightIndex coordIndex, uint& subChunkIndex);
75
76 MCNAPI ::SubChunk*
77 _getBlock(::SubChunkLightIndex coordIndex, ::Block const*& block, ::Block const*& extraBlock) const;
78
79 MCNAPI ::SubChunk* _getBlock(
80 ::SubChunkLightIndex coordIndex,
81 ::Block const*& block,
82 ::Block const*& extraBlock,
83 uint& subChunkIndex
84 ) const;
85
86 MCNAPI ::SubChunkBrightnessStorage::LightPair _getLightPair(::SubChunkLightIndex coordIndex) const;
87
88 MCNAPI void _propagateBlockLight();
89
90 MCNAPI void _propagateBlockLight(::SubChunkLightIndex coordIndex, uchar brightness);
91
92 MCNAPI void _propagateSkyLight();
93
94 MCNAPI void _propagateSkyLight(::SubChunkLightIndex coordIndex, uchar brightness);
95
97
98 MCNAPI void _propagateSubtractiveBlockLight(::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
99
100 MCNAPI void _propagateSubtractiveSkyLight(bool shouldCheckForIgnoredAbsorptionValues);
101
102 MCNAPI void _propagateSubtractiveSkyLight(::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
103
104 MCNAPI void _setLightHelper(
105 ::SubChunkLightIndex coordIndex,
106 ::Brightness oldBrightness,
107 ::Brightness newBrightness,
108 ::Brightness oldAbsorption,
109 ::Brightness newAbsorption,
110 uint lightType,
111 uint subChunkIndex
112 );
113
114 MCNAPI void _setPropagatedBlockLightValue(::SubChunkLightIndex coordIndex, uchar brightness);
115
116 MCNAPI void _setPropagatedSkyLightValue(::SubChunkLightIndex coordIndex, uchar brightness);
117
118 MCNAPI void _setSkyLight(
119 ::SubChunkLightIndex coordIndex,
120 ::Brightness oldBrightness,
121 ::Brightness newBrightness,
122 ::Brightness oldAbsorption,
123 ::Brightness newAbsorption
124 );
125
126 MCNAPI void relightSubChunk(
127 ::LevelChunk const& levelChunk,
128 ::std::vector<::SubChunkLightUpdate> const& alteredBlockList,
129 ::std::vector<::BlockPos>& brightnessChangedList
130 );
131
132 MCNAPI void setBlockLight(
133 ::Pos const& pos,
134 ::Brightness oldBrightness,
135 ::Brightness newBrightness,
136 ::Brightness oldAbsorption,
137 ::Brightness newAbsorption
138 );
139
141 // NOLINTEND
142
143public:
144 // static functions
145 // NOLINTBEGIN
147
148 MCNAPI static ::std::bitset<196608> computeOuterEdgeOfComputationBits();
149
150 MCNAPI static void initializeStatics();
151 // NOLINTEND
152
153public:
154 // static variables
155 // NOLINTBEGIN
156 MCNAPI static ::std::bitset<196608>& mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
157
158 MCNAPI static ::std::bitset<196608>& mOuterEdgeOfComputationBits();
159
160 MCNAPI static ::SpinLockImpl& sDarkSpinLock();
161
162 MCNAPI static ::std::unique_ptr<::SubChunk>& sFullyDarkSubChunk();
163
164 MCNAPI static ::std::unique_ptr<::SubChunk>& sFullyLitSubChunk();
165
166 MCNAPI static ::SpinLockImpl& sLitSpinLock();
167 // NOLINTEND
168
169public:
170 // constructor thunks
171 // NOLINTBEGIN
172 MCNAPI void* $ctor(
173 ::IBlockSource& source,
174 uint64 centerSubChunkIndex,
175 ::ChunkPos const& centerChunkPos,
176 bool isClientSide,
177 bool originalLighting,
178 bool useFullyDarkSubchunk
179 );
180 // NOLINTEND
181
182public:
183 // destructor thunk
184 // NOLINTBEGIN
185 MCNAPI void $dtor();
186 // NOLINTEND
187};
Definition BlockPos.h:17
Definition Block.h:37
Definition ChunkPos.h:11
Definition IBlockSource.h:35
Definition LevelChunk.h:77
Definition Pos.h:5
Definition SpinLockImpl.h:5
Definition SubChunkRelighter.h:24
MCAPI void _setSkyLight(::SubChunkLightIndex coordIndex, ::Brightness oldBrightness, ::Brightness newBrightness, ::Brightness oldAbsorption, ::Brightness newAbsorption)
MCAPI void setBlockLight(::Pos const &pos, ::Brightness oldBrightness, ::Brightness newBrightness, ::Brightness oldAbsorption, ::Brightness newAbsorption)
MCAPI void _setLightHelper(::SubChunkLightIndex coordIndex, ::Brightness oldBrightness, ::Brightness newBrightness, ::Brightness oldAbsorption, ::Brightness newAbsorption, uint lightType, uint subChunkIndex)
MCAPI SubChunkRelighter(::IBlockSource &source, uint64 centerSubChunkIndex, ::ChunkPos const &centerChunkPos, bool isClientSide, bool originalLighting, bool useFullyDarkSubchunk)
MCAPI void _setPropagatedSkyLightValue(::SubChunkLightIndex coordIndex, uchar brightness)
static MCAPI ::std::bitset< 196608 > & mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits()
MCAPI void _propagateSkyLight(::SubChunkLightIndex coordIndex, uchar brightness)
MCAPI::SubChunk * _getBlock(::SubChunkLightIndex coordIndex, ::Block const *&block, ::Block const *&extraBlock, uint &subChunkIndex) const
static MCAPI ::std::bitset< 196608 > computeAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits()
static MCAPI ::SpinLockImpl & sLitSpinLock()
MCAPI void _propagateSkyLight()
static MCAPI void initializeStatics()
MCAPI void $dtor()
MCAPI void _propagateBlockLight()
static MCAPI ::std::unique_ptr<::SubChunk > & sFullyDarkSubChunk()
MCAPI void _checkEdgeForSubtractiveBlockLightProcessing(::SubChunkLightIndex const &coordIndex)
MCAPI void _checkEdgeForSubtractiveSkyLightProcessing(::SubChunkLightIndex const &coordIndex)
MCAPI::SubChunk * _dirtySubChunk(::SubChunkLightIndex coordIndex, uint &subChunkIndex)
static MCAPI ::SpinLockImpl & sDarkSpinLock()
MCAPI void * $ctor(::IBlockSource &source, uint64 centerSubChunkIndex, ::ChunkPos const &centerChunkPos, bool isClientSide, bool originalLighting, bool useFullyDarkSubchunk)
MCAPI ~SubChunkRelighter()
static MCAPI ::std::bitset< 196608 > & mOuterEdgeOfComputationBits()
MCAPI void _propagateSubtractiveBlockLight()
MCAPI void relightSubChunk(::LevelChunk const &levelChunk, ::std::vector<::SubChunkLightUpdate > const &alteredBlockList, ::std::vector<::BlockPos > &brightnessChangedList)
MCAPI void _propagateBlockLight(::SubChunkLightIndex coordIndex, uchar brightness)
MCAPI void _propagateSubtractiveSkyLight(::SubChunkLightIndex coordIndex, uchar effectiveBrightness)
static MCAPI ::std::unique_ptr<::SubChunk > & sFullyLitSubChunk()
static MCAPI ::std::bitset< 196608 > computeOuterEdgeOfComputationBits()
MCAPI::SubChunk * _getBlock(::SubChunkLightIndex coordIndex, ::Block const *&block, ::Block const *&extraBlock) const
MCAPI void _propagateSubtractiveBlockLight(::SubChunkLightIndex coordIndex, uchar effectiveBrightness)
MCAPI void _propagateSubtractiveSkyLight(bool shouldCheckForIgnoredAbsorptionValues)
MCAPI void _setPropagatedBlockLightValue(::SubChunkLightIndex coordIndex, uchar brightness)
MCAPI::SubChunkBrightnessStorage::LightPair _getLightPair(::SubChunkLightIndex coordIndex) const
Definition Brightness.h:8
Definition SubChunkBrightnessStorage.h:13
Definition SubChunkLightIndex.h:5
Definition SubChunkLightUpdate.h:9
Definition SubChunk.h:24
Definition SubtractiveLightInfo.h:5