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 ::SubChunkBrightnessStorage::LightPair _getLightPair(::SubChunkLightIndex coordIndex) const;
80
81 MCNAPI void _propagateBlockLight();
82
83 MCNAPI void _propagateBlockLight(::SubChunkLightIndex coordIndex, uchar brightness);
84
85 MCNAPI void _propagateSkyLight();
86
87 MCNAPI void _propagateSkyLight(::SubChunkLightIndex coordIndex, uchar brightness);
88
90
91 MCNAPI void _propagateSubtractiveBlockLight(::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
92
93 MCNAPI void _propagateSubtractiveSkyLight(bool shouldCheckForIgnoredAbsorptionValues);
94
95 MCNAPI void _propagateSubtractiveSkyLight(::SubChunkLightIndex coordIndex, uchar effectiveBrightness);
96
97 MCNAPI void _setLightHelper(
98 ::SubChunkLightIndex coordIndex,
99 ::Brightness oldBrightness,
100 ::Brightness newBrightness,
101 ::Brightness oldAbsorption,
102 ::Brightness newAbsorption,
103 uint lightType,
104 uint subChunkIndex
105 );
106
107 MCNAPI void _setPropagatedBlockLightValue(::SubChunkLightIndex coordIndex, uchar brightness);
108
109 MCNAPI void _setPropagatedSkyLightValue(::SubChunkLightIndex coordIndex, uchar brightness);
110
111 MCNAPI void _setSkyLight(
112 ::SubChunkLightIndex coordIndex,
113 ::Brightness oldBrightness,
114 ::Brightness newBrightness,
115 ::Brightness oldAbsorption,
116 ::Brightness newAbsorption
117 );
118
119 MCNAPI void relightSubChunk(
120 ::LevelChunk const& levelChunk,
121 ::std::vector<::SubChunkLightUpdate> const& alteredBlockList,
122 ::std::vector<::BlockPos>& brightnessChangedList
123 );
124
125 MCNAPI void setBlockLight(
126 ::Pos const& pos,
127 ::Brightness oldBrightness,
128 ::Brightness newBrightness,
129 ::Brightness oldAbsorption,
130 ::Brightness newAbsorption
131 );
132
134 // NOLINTEND
135
136public:
137 // static functions
138 // NOLINTBEGIN
140
141 MCNAPI static ::std::bitset<196608> computeOuterEdgeOfComputationBits();
142
143 MCNAPI static void initializeStatics();
144 // NOLINTEND
145
146public:
147 // static variables
148 // NOLINTBEGIN
149 MCNAPI static ::std::bitset<196608>& mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
150
151 MCNAPI static ::std::bitset<196608>& mOuterEdgeOfComputationBits();
152
153 MCNAPI static ::SpinLockImpl& sDarkSpinLock();
154
155 MCNAPI static ::std::unique_ptr<::SubChunk>& sFullyDarkSubChunk();
156
157 MCNAPI static ::std::unique_ptr<::SubChunk>& sFullyLitSubChunk();
158
159 MCNAPI static ::SpinLockImpl& sLitSpinLock();
160 // NOLINTEND
161
162public:
163 // constructor thunks
164 // NOLINTBEGIN
165 MCNAPI void* $ctor(
166 ::IBlockSource& source,
167 uint64 centerSubChunkIndex,
168 ::ChunkPos const& centerChunkPos,
169 bool isClientSide,
170 bool originalLighting,
171 bool useFullyDarkSubchunk
172 );
173 // NOLINTEND
174
175public:
176 // destructor thunk
177 // NOLINTBEGIN
178 MCNAPI void $dtor();
179 // NOLINTEND
180};
Definition BlockPos.h:18
Definition Block.h:38
Definition ChunkPos.h:11
Definition IBlockSource.h:35
Definition LevelChunk.h:74
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)
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