Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
AtlasImpl.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/geometry_atlas/AtlasDimensions.h"
7#include "mc/client/gui/geometry_atlas/CommandDispatcherArgs.h"
8#include "mc/client/gui/geometry_atlas/IGeometryAtlas.h"
9#include "mc/client/gui/geometry_atlas/ItemData.h"
10#include "mc/client/gui/geometry_atlas/PaperDollData.h"
11#include "mc/client/gui/geometry_atlas/RenderableUpdateCommand.h"
12#include "mc/deps/core/threading/BasicLockbox.h"
13#include "mc/deps/core/utility/pub_sub/Connector.h"
14#include "mc/deps/core/utility/pub_sub/Publisher.h"
15#include "mc/external/render_dragon/atlas/AtlasTileDescription.h"
16#include "mc/external/render_dragon/atlas/AtlasTileHandle.h"
17#include "mc/platform/brstd/flat_map.h"
18
19// auto generated forward declare list
20// clang-format off
21namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
22namespace GeometryAtlas { class IItemTile; }
23namespace GeometryAtlas { class IPaperDollTile; }
24namespace GeometryAtlas { class IRenderContext; }
25namespace GeometryAtlas { struct AllocateAtlasPayload; }
26namespace GeometryAtlas { struct TileDefinition; }
27namespace GeometryAtlas { struct TileHandleSharedState; }
28namespace dragon::atlas { class IAtlasHandle; }
29// clang-format on
30
31namespace GeometryAtlas {
32
33class AtlasImpl : public ::GeometryAtlas::IGeometryAtlas {
34public:
35 // AtlasImpl inner types declare
36 // clang-format off
37 class TileEntry;
38 struct CommandArgs;
39 struct AtlasEntry;
40 struct Data;
41 struct TileDirtyUpdate;
42 struct mDispatcher;
43 // clang-format on
44
45 // AtlasImpl inner types define
46 enum class TileDirtyStatus : uchar {
47 NewUserData = 0,
48 SubmittedForRendering = 1,
49 UpToDate = 2,
50 };
51
52 class TileEntry {
53 public:
54 // TileEntry inner types define
55 enum class Status : uchar {
56 Uninitialized = 0,
57 Initialized = 1,
58 FailedInitialization = 2,
59 };
60
61 public:
62 // member variables
63 // NOLINTBEGIN
64 ::ll::TypedStorage<8, 72, ::std::variant<::GeometryAtlas::ItemData, ::GeometryAtlas::PaperDollData>> mData;
65 ::ll::TypedStorage<1, 1, bool> mIsAnimated;
66 ::ll::TypedStorage<4, 8, ::dragon::atlas::AtlasTileDescription const> mTileDescription;
67 ::ll::TypedStorage<1, 1, ::GeometryAtlas::AtlasImpl::TileEntry::Status> mStatus;
68 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GeometryAtlas::TileHandleSharedState>> mShared;
69 ::ll::TypedStorage<8, 32, ::dragon::atlas::AtlasTileHandle> mBackendID;
70 // NOLINTEND
71 };
72
73 struct CommandArgs {
74 public:
75 // member variables
76 // NOLINTBEGIN
77 ::ll::TypedStorage<8, 8, ::GeometryAtlas::IRenderContext&> mContext;
78 ::ll::TypedStorage<
79 8,
80 8,
81 ::std::_List_iterator<::std::_List_val<
82 ::std::_List_simple_types<::std::pair<uint const, ::GeometryAtlas::AtlasImpl::TileEntry>>>>>
83 mIt;
84 ::ll::TypedStorage<8, 8, ::GeometryAtlas::AtlasImpl::TileEntry*> mEntry;
85 ::ll::TypedStorage<4, 4, uint> mTileID;
86 // NOLINTEND
87
88 public:
89 // prevent constructor by default
90 CommandArgs& operator=(CommandArgs const&);
91 CommandArgs(CommandArgs const&);
92 CommandArgs();
93 };
94
95 struct AtlasEntry {
96 public:
97 // member variables
98 // NOLINTBEGIN
99 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::dragon::atlas::IAtlasHandle>> mHandle;
100 ::ll::TypedStorage<2, 4, ::GeometryAtlas::AtlasDimensions> mDimensions;
101 // NOLINTEND
102 };
103
104 struct Data {
105 public:
106 // member variables
107 // NOLINTBEGIN
108 ::ll::TypedStorage<8, 24, ::std::vector<::GeometryAtlas::AtlasImpl::AtlasEntry>> mAtlases;
109 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint, ::GeometryAtlas::AtlasImpl::TileEntry>> mTiles;
110 ::ll::TypedStorage<
111 8,
112 120,
113 ::Bedrock::Threading::BasicLockbox<::std::deque<::GeometryAtlas::RenderableUpdateCommand>, ::std::mutex>>
114 mCommands;
115 ::ll::TypedStorage<8, 24, ::std::vector<::GeometryAtlas::RenderableUpdateCommand>> mFutureCommands;
116 ::ll::TypedStorage<
117 8,
118 48,
119 ::brstd::flat_map<
120 uint,
121 ::GeometryAtlas::AtlasImpl::TileDirtyStatus,
122 ::std::less<uint>,
123 ::std::vector<uint>,
124 ::std::vector<::GeometryAtlas::AtlasImpl::TileDirtyStatus>>>
125 mDirtyTiles;
126 ::ll::TypedStorage<8, 24, ::std::vector<uint>> mTileNotifications;
127 // NOLINTEND
128 };
129
130 struct TileDirtyUpdate {
131 public:
132 // member variables
133 // NOLINTBEGIN
134 ::ll::TypedStorage<1, 1, ::GeometryAtlas::AtlasImpl::TileDirtyStatus> mNewStatus;
135 ::ll::TypedStorage<1, 1, bool> mSubmitTileRender;
136 ::ll::TypedStorage<1, 1, bool> mNotifyTileUpdated;
137 // NOLINTEND
138 };
139
140 struct mDispatcher {};
141
142 using CommandBuffer = ::std::deque<::GeometryAtlas::RenderableUpdateCommand>;
143
144public:
145 // member variables
146 // NOLINTBEGIN
147 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GeometryAtlas::AtlasImpl::Data>> mData;
148 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GeometryAtlas::CommandDispatcherArgs::DispatchFunctions>> mDispatcher;
149 ::ll::TypedStorage<
150 8,
151 128,
152 ::Bedrock::PubSub::
153 Publisher<void(::std::vector<uint> const&), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
154 mTileChangePublisher;
155 // NOLINTEND
156
157public:
158 // virtual functions
159 // NOLINTBEGIN
160 virtual ::std::shared_ptr<::GeometryAtlas::IItemTile>
161 createItem(::GeometryAtlas::TileDefinition const& definition) /*override*/;
162
163 virtual ::std::shared_ptr<::GeometryAtlas::IPaperDollTile>
164 createDoll(::GeometryAtlas::TileDefinition const& definition) /*override*/;
165
166 virtual void trySubmitUpdates(::GeometryAtlas::IRenderContext& context) /*override*/;
167
168 virtual bool hasAnyUpdates() const /*override*/;
169
170 virtual ::Bedrock::PubSub::Connector<void(::std::vector<uint> const&)>& getTileChangeConnector() /*override*/;
171 // NOLINTEND
172
173public:
174 // member functions
175 // NOLINTBEGIN
176 MCNAPI AtlasImpl();
177
178 MCNAPI void
179 _processCommand(::GeometryAtlas::AtlasImpl::CommandArgs& args, ::GeometryAtlas::AllocateAtlasPayload&& payload);
180 // NOLINTEND
181
182public:
183 // constructor thunks
184 // NOLINTBEGIN
185 MCNAPI void* $ctor();
186 // NOLINTEND
187
188public:
189 // virtual function thunks
190 // NOLINTBEGIN
191 MCNAPI ::std::shared_ptr<::GeometryAtlas::IItemTile> $createItem(::GeometryAtlas::TileDefinition const& definition);
192
193 MCNAPI ::std::shared_ptr<::GeometryAtlas::IPaperDollTile>
194 $createDoll(::GeometryAtlas::TileDefinition const& definition);
195
196 MCNAPI void $trySubmitUpdates(::GeometryAtlas::IRenderContext& context);
197
198 MCNAPI bool $hasAnyUpdates() const;
199
200 MCNAPI ::Bedrock::PubSub::Connector<void(::std::vector<uint> const&)>& $getTileChangeConnector();
201 // NOLINTEND
202};
203
204} // namespace GeometryAtlas
Definition Connector.h:19
Definition AtlasImpl.h:21
Definition AtlasImpl.h:7
MCAPI void $trySubmitUpdates(::GeometryAtlas::IRenderContext &context)
MCAPI void _processCommand(::GeometryAtlas::AtlasImpl::CommandArgs &args, ::GeometryAtlas::AllocateAtlasPayload &&payload)
MCAPI ::std::shared_ptr<::GeometryAtlas::IItemTile > $createItem(::GeometryAtlas::TileDefinition const &definition)
MCAPI ::std::shared_ptr<::GeometryAtlas::IPaperDollTile > $createDoll(::GeometryAtlas::TileDefinition const &definition)
MCAPI bool $hasAnyUpdates() const
MCAPI ::Bedrock::PubSub::Connector< void(::std::vector< uint > const &)> & $getTileChangeConnector()
Definition IItemTile.h:7
Definition IPaperDollTile.h:7
Definition IRenderContext.h:7
Definition IAtlasHandle.h:7
STL namespace.
Definition AllocateAtlasPayload.h:7
Definition AtlasImpl.h:29
Definition AtlasImpl.h:27
Definition AtlasImpl.h:31
Definition AtlasImpl.h:140
Definition TileDefinition.h:7
Definition TileHandleSharedState.h:7
Definition context.h:5