Skip to content
LeviLamina

API Reference

On this page

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;
16struct Brightness;
17struct SubChunk;
21// clang-format on
22
23class SubChunkRelighter {
24public:
25 // SubChunkRelighter inner types define
26 enum class AbsorptionBehavior : int {
27 Default = 0,
28 SkyLightIgnoresWater = 1,
29 };
30
31 enum class SubChunkToDoBitsClearMode : int {
32 AllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits = 0,
33 SetOuterEdgeOfComputationBits = 1,
34 };
35
37
38public:
39 // member variables
40 // NOLINTBEGIN
41 ::ll::TypedStorage<1, 1, bool> mNeedToResetToDoBits;
42 ::ll::TypedStorage<8, 24576, ::std::bitset<196608>> mToDo;
43 ::ll::TypedStorage<1, 4096, ::std::array<uchar, 4096>> mOldAbsorption;
44 ::ll::TypedStorage<8, 768, ::std::vector<::SubChunkLightIndex>[2][16]> mAdditiveBlocksToProcess;
45 ::ll::TypedStorage<8, 384, ::std::vector<::SubChunkLightIndex>[16]> mEdgeBlocksToProcess;
46 ::ll::TypedStorage<8, 384, ::std::vector<::SubChunkLightIndex>[16]> mBlocksToProcess;
47 ::ll::TypedStorage<8, 24, ::std::vector<::SubChunkLightIndex>> mAbsorptionBlocksToProcess;
48 ::ll::TypedStorage<8, 48, ::std::vector<::SubtractiveLightInfo>[2]> mSubtractiveBlocks;
49 ::ll::TypedStorage<8, 384, ::SubChunk* [3][4][4]> mSubChunkPtrArray;
50 ::ll::TypedStorage<1, 48, bool[3][4][4]> mSubChunkTouched;
51 ::ll::TypedStorage<8, 8, ::ChunkPos> mCenterChunkPos;
52 ::ll::TypedStorage<8, 8, uint64> mCenterSubChunkIndex;
53 ::ll::TypedStorage<1, 1, bool> mOriginalLighting;
54 ::ll::TypedStorage<4, 4, ::SubChunkRelighter::AbsorptionBehavior> mAbsorptionBehavior;
55 ::ll::TypedStorage<1, 1, ::SubChunkBrightnessStorage::LightPair> mDefaultLightPair;
56 // NOLINTEND
57
58public:
59 // prevent constructor by default
60 SubChunkRelighter();
61
62public:
63 // member functions
64 // NOLINTBEGIN
66 ::IBlockSource& source,
67 uint64 centerSubChunkIndex,
68 ::ChunkPos const& centerChunkPos,
69 ::SubChunkRelighter::AbsorptionBehavior absorptionBehavior,
70 bool originalLighting,
71 bool useFullyDarkSubchunk
72 );
73
75
77
78 MCNAPI ::SubChunk* _dirtySubChunk(::SubChunkLightIndex const coordIndex, uint& subChunkIndex);
79
80 MCNAPI void _propagateBlockLight();
81
82 MCNAPI void _propagateSkyLight();
83
85
87
88 MCNAPI void _setLightHelper(
89 ::SubChunkLightIndex coordIndex,
90 ::Brightness oldBrightness,
91 ::Brightness newBrightness,
92 ::Brightness oldAbsorption,
93 ::Brightness newAbsorption,
94 uint lightType,
95 uint subChunkIndex
96 );
97
98 MCNAPI void _setPropagatedBlockLightValue(::SubChunkLightIndex coordIndex, uchar brightness);
99
100 MCNAPI void _setPropagatedSkyLightValue(::SubChunkLightIndex coordIndex, uchar brightness);
101
102 MCNAPI void _setSkyLight(
103 ::SubChunkLightIndex coordIndex,
104 ::Brightness oldBrightness,
105 ::Brightness newBrightness,
106 ::Brightness oldAbsorption,
107 ::Brightness newAbsorption
108 );
109
110 MCNAPI void getBlock(::Pos const& pos, ::Block const*& block, ::Block const*& extraBlock);
111
112 MCNAPI ::SubChunkBrightnessStorage::LightPair getLightPair(::Pos const& coord) const;
113
114 MCNAPI ::SubChunkBrightnessStorage::LightPair getLightPairWithPlaceholderCheck(
115 ::Pos const& coord,
116 ::SubChunkBrightnessStorage::LightPair const& defaultLightPairIfPlaceholderSubChunk
117 ) const;
118
119#ifdef LL_PLAT_C
120 MCNAPI void relightSubChunk(
121 ::LevelChunk const& levelChunk,
122 ::std::vector<::SubChunkLightUpdate> const& alteredBlockList,
123 ::std::vector<::BlockPos>& brightnessChangedList
124 );
125#endif
126
128 // NOLINTEND
129
130public:
131 // static functions
132 // NOLINTBEGIN
133 MCNAPI static void initializeStatics();
134
135#ifdef LL_PLAT_S
136 MCNAPI static void shutdownStatics();
137#endif
138 // NOLINTEND
139
140public:
141 // static variables
142 // NOLINTBEGIN
143 MCNAPI static ::std::bitset<196608>& mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits();
144
145 MCNAPI static ::std::bitset<196608>& mOuterEdgeOfComputationBits();
146
147 MCNAPI static ::std::unique_ptr<::SubChunk>& sFullyDarkSubChunk();
148
149 MCNAPI static ::std::unique_ptr<::SubChunk>& sFullyLitSubChunk();
150 // NOLINTEND
151
152public:
153 // constructor thunks
154 // NOLINTBEGIN
155 MCNAPI void* $ctor(
156 ::IBlockSource& source,
157 uint64 centerSubChunkIndex,
158 ::ChunkPos const& centerChunkPos,
159 ::SubChunkRelighter::AbsorptionBehavior absorptionBehavior,
160 bool originalLighting,
161 bool useFullyDarkSubchunk
162 );
163 // NOLINTEND
164
165public:
166 // destructor thunk
167 // NOLINTBEGIN
168 MCNAPI void $dtor();
169 // NOLINTEND
170};
Definition BlockPos.h:14
Definition Block.h:42
Definition ChunkPos.h:13
Definition IBlockSource.h:39
Definition LevelChunk.h:76
Definition Pos.h:5
MCAPI void _setSkyLight(::SubChunkLightIndex coordIndex, ::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 void _setPropagatedSkyLightValue(::SubChunkLightIndex coordIndex, uchar brightness)
MCAPI::SubChunkBrightnessStorage::LightPair getLightPair(::Pos const &coord) const
MCAPI void getBlock(::Pos const &pos, ::Block const *&block, ::Block const *&extraBlock)
static MCAPI ::std::bitset< 196608 > & mAllSubChunkBorderBitsExceptTheOuterEdgeOfComputationBits()
MCAPI void _propagateSkyLight()
MCAPI::SubChunkBrightnessStorage::LightPair getLightPairWithPlaceholderCheck(::Pos const &coord, ::SubChunkBrightnessStorage::LightPair const &defaultLightPairIfPlaceholderSubChunk) const
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 void * $ctor(::IBlockSource &source, uint64 centerSubChunkIndex, ::ChunkPos const &centerChunkPos, ::SubChunkRelighter::AbsorptionBehavior absorptionBehavior, bool originalLighting, bool useFullyDarkSubchunk)
MCAPI ~SubChunkRelighter()
MCAPI SubChunkRelighter(::IBlockSource &source, uint64 centerSubChunkIndex, ::ChunkPos const &centerChunkPos, ::SubChunkRelighter::AbsorptionBehavior absorptionBehavior, bool originalLighting, bool useFullyDarkSubchunk)
static MCAPI ::std::bitset< 196608 > & mOuterEdgeOfComputationBits()
MCAPI void _propagateSubtractiveBlockLight()
static MCAPI ::std::unique_ptr<::SubChunk > & sFullyLitSubChunk()
MCAPI::SubChunk * _dirtySubChunk(::SubChunkLightIndex const coordIndex, uint &subChunkIndex)
MCAPI void _propagateSubtractiveSkyLight()
MCAPI void _setPropagatedBlockLightValue(::SubChunkLightIndex coordIndex, uchar brightness)
Definition Brightness.h:8
Definition SubChunkBrightnessStorage.h:13
Definition SubChunkLightIndex.h:5
Definition SubChunkLightUpdate.h:9
Definition SubChunk.h:26
Definition SubtractiveLightInfo.h:9