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/chunk/SubChunkBrightnessStorage.h"
7
8// auto generated forward declare list
9// clang-format off
10class Block;
11class BlockPos;
12class ChunkPos;
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, ::SubChunkBrightnessStorage::LightPair> mDefaultLightPair;
51 // NOLINTEND
52
53public:
54 // member functions
55 // NOLINTBEGIN
57 ::IBlockSource& source,
58 uint64 centerSubChunkIndex,
59 ::ChunkPos const& centerChunkPos,
60 bool originalLighting,
61 bool useFullyDarkSubchunk
62 );
63
64 MCAPI void _checkEdgeForSubtractiveBlockLightProcessing(::SubChunkLightIndex const& coordIndex);
65
66 MCAPI void _checkEdgeForSubtractiveSkyLightProcessing(::SubChunkLightIndex const& coordIndex);
67
68 MCAPI ::SubChunk* _dirtySubChunk(::SubChunkLightIndex coordIndex, uint& subChunkIndex);
69
70 MCAPI ::SubChunk*
71 _getBlock(::SubChunkLightIndex coordIndex, ::Block const*& block, ::Block const*& extraBlock) const;
72
73 MCAPI ::SubChunkBrightnessStorage::LightPair _getLightPair(::SubChunkLightIndex coordIndex) const;
74
75 MCAPI void _propagateBlockLight();
76
77 MCAPI void _propagateBlockLight(::SubChunkLightIndex coordIndex, uchar brightness);
78
79 MCAPI void _propagateSkyLight();
80
81 MCAPI void _propagateSkyLight(::SubChunkLightIndex coordIndex, uchar brightness);
82
83 MCAPI void _propagateSubtractiveBlockLight();
84
85 MCAPI void _propagateSubtractiveBlockLight(::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
86
87 MCAPI void _propagateSubtractiveSkyLight();
88
89 MCAPI void _propagateSubtractiveSkyLight(::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
90
91 MCAPI void _setLightHelper(
92 ::SubChunkLightIndex coordIndex,
93 ::Brightness oldBrightness,
94 ::Brightness newBrightness,
95 ::Brightness oldAbsorption,
96 ::Brightness newAbsorption,
97 uint lightType,
98 uint subChunkIndex
99 );
100
101 MCAPI void _setPropagatedBlockLightValue(::SubChunkLightIndex coordIndex, uchar brightness);
102
103 MCAPI void _setPropagatedSkyLightValue(::SubChunkLightIndex coordIndex, uchar brightness);
104
105 MCAPI void _setSkyLight(
106 ::SubChunkLightIndex coordIndex,
107 ::Brightness oldBrightness,
108 ::Brightness newBrightness,
109 ::Brightness oldAbsorption,
110 ::Brightness newAbsorption
111 );
112
113 MCAPI void relightSubChunk(
114 ::LevelChunk const& levelChunk,
115 ::std::vector<::SubChunkLightUpdate> const& alteredBlockList,
116 ::std::vector<::BlockPos>& brightnessChangedList
117 );
118
119 MCAPI void setBlockLight(
120 ::Pos const& pos,
121 ::Brightness oldBrightness,
122 ::Brightness newBrightness,
123 ::Brightness oldAbsorption,
124 ::Brightness newAbsorption
125 );
126
127 MCAPI ~SubChunkRelighter();
128 // NOLINTEND
129
130public:
131 // static functions
132 // NOLINTBEGIN
133 MCAPI static ::std::bitset<196608> computeAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
134
135 MCAPI static ::std::bitset<196608> computeOuterEdgeOfComputationBits();
136
137 MCAPI static void initializeStatics();
138 // NOLINTEND
139
140public:
141 // static variables
142 // NOLINTBEGIN
143 MCAPI static ::std::bitset<196608>& mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
144
145 MCAPI static ::std::bitset<196608>& mOuterEdgeOfComputationBits();
146
147 MCAPI static ::SpinLockImpl& sDarkSpinLock();
148
149 MCAPI static ::std::unique_ptr<::SubChunk>& sFullyDarkSubChunk();
150
151 MCAPI static ::std::unique_ptr<::SubChunk>& sFullyLitSubChunk();
152
153 MCAPI static ::SpinLockImpl& sLitSpinLock();
154 // NOLINTEND
155
156public:
157 // constructor thunks
158 // NOLINTBEGIN
159 MCAPI void* $ctor(
160 ::IBlockSource& source,
161 uint64 centerSubChunkIndex,
162 ::ChunkPos const& centerChunkPos,
163 bool originalLighting,
164 bool useFullyDarkSubchunk
165 );
166 // NOLINTEND
167
168public:
169 // destructor thunk
170 // NOLINTBEGIN
171 MCAPI void $dtor();
172 // NOLINTEND
173};
Definition BlockPos.h:18
Definition Block.h:36
Definition ChunkPos.h:11
Definition IBlockSource.h:35
Definition LevelChunk.h:73
Definition Pos.h:5
Definition SpinLockImpl.h:5
Definition SubChunkRelighter.h:24
Definition Brightness.h:8
Definition SubChunkBrightnessStorage.h:13
Definition SubChunkLightIndex.h:5
Definition SubChunkLightUpdate.h:11
Definition SubChunk.h:24
Definition SubtractiveLightInfo.h:5