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