LeviLamina
Loading...
Searching...
No Matches
ChunkBlenderFactory.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/ScalarOptional.h"
8#include "mc/world/level/biome/BiomeIdType.h"
9
10// auto generated forward declare list
11// clang-format off
12class BlendingData;
13class ChunkBlender;
14class ChunkSource;
15namespace ChunkBlenderUtil { struct AttenuationData; }
16// clang-format on
17
18class ChunkBlenderFactory {
19public:
20 // ChunkBlenderFactory inner types declare
21 // clang-format off
22 struct BlendCheckEntry;
24 // clang-format on
25
26 // ChunkBlenderFactory inner types define
28 public:
29 // member variables
30 // NOLINTBEGIN
31 ::ll::TypedStorage<8, 8, ::ChunkPos> checkPosition;
32 ::ll::TypedStorage<1, 1, bool> adjacentChunk;
33 // NOLINTEND
34 };
35
37 public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<4, 4, float> mDistanceToBlendTarget;
41 ::ll::TypedStorage<4, 4, float> mWeightedHeight;
42 ::ll::TypedStorage<4, 4, float> mTotalHeightWeight;
43 ::ll::TypedStorage<4, 4, float> mTotalDensityWeight;
44 ::ll::TypedStorage<4, 164, ::std::array<::ScalarOptional<float>, 41>> mWeightedDensities;
45 ::ll::TypedStorage<1, 41, ::std::array<::ScalarOptional<schar>, 41>> mBlockTypeWeights;
46 ::ll::TypedStorage<2, 192, ::std::array<::ScalarOptional<::BiomeIdType>, 96>> mBiome;
47 ::ll::TypedStorage<1, 1, bool> mHaveBlockTypes;
48 ::ll::TypedStorage<1, 1, bool> mSyncPoint;
49 // NOLINTEND
50 };
51
52 using ChunkIntermediateAttenuationData =
53 ::std::vector<::std::array<::ChunkBlenderFactory::IntermediateAttenuationData, 4>>;
54
55public:
56 // member variables
57 // NOLINTBEGIN
58 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkPos, ::std::shared_ptr<::ChunkBlender>>> mAttenuatorCache;
59 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mAttenuatorSharedMutex;
60 ::ll::TypedStorage<1, 1, bool const> mIsClientSide;
61 ::ll::TypedStorage<8, 8, ::ChunkSource*> mChunkSource;
62 ::ll::TypedStorage<2, 2, short const> mDimensionMinHeight;
63 // NOLINTEND
64
65public:
66 // prevent constructor by default
67 ChunkBlenderFactory();
68
69public:
70 // member functions
71 // NOLINTBEGIN
72 MCAPI ChunkBlenderFactory(bool isClientSide, short dimensionMinHeight);
73
74 MCAPI ::std::shared_ptr<::ChunkBlender> _createChunkBlendingAttenuator(::ChunkPos const& lcPosition) const;
75
76 MCAPI ::std::vector<::std::array<::ChunkBlenderUtil::AttenuationData, 4>> _finalizeChunkAttenuationData(
77 ::std::vector<::std::array<::ChunkBlenderFactory::IntermediateAttenuationData, 4>> const&
78 chunkIntermediateAttenuationData
79 ) const;
80
81 MCAPI void _updateIntermediateAttenuationData(
82 ::std::vector<::std::array<::ChunkBlenderFactory::IntermediateAttenuationData, 4>>&
83 chunkIntermediateAttenuationData,
84 ::ChunkPos const& oldChunkPosition,
85 ::ChunkPos const& newChunkPosition,
86 ::BlendingData const& blendingData,
87 bool adjacentChunk
88 ) const;
89
90 MCAPI void freeChunkBlenderCache();
91
92 MCAPI ::std::shared_ptr<::ChunkBlender> getOrCreateChunkBlender(::ChunkPos const& lcPosition);
93
94 MCFOLD bool isClientSide() const;
95 // NOLINTEND
96
97public:
98 // constructor thunks
99 // NOLINTBEGIN
100 MCAPI void* $ctor(bool isClientSide, short dimensionMinHeight);
101 // NOLINTEND
102};
Definition BlendingData.h:14
Definition ChunkBlender.h:21
Definition ChunkPos.h:11
Definition ChunkSource.h:37
Definition ChunkBlenderFactory.h:27
Definition ChunkBlenderFactory.h:36
Definition AttenuationData.h:12