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