LeviLamina
Loading...
Searching...
No Matches
TextureAtlas.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/renderer/ImageResourceManager.h"
7#include "mc/client/renderer/texture/AtlasParameters.h"
8#include "mc/client/renderer/texture/ParsedAtlasData.h"
9#include "mc/client/renderer/texture/TextureAtlasStatus.h"
10#include "mc/deps/core/resource/ResourceLocation.h"
11#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
12#include "mc/deps/core/utility/NonOwnerPointer.h"
13#include "mc/deps/core_graphics/MipMapSupport.h"
14#include "mc/deps/core_graphics/TextureAtlas.h"
15
16// auto generated forward declare list
17// clang-format off
20struct AtlasItemManager;
21struct ParsedAtlasNode;
25namespace Json { class Value; }
26namespace cg { class ImageBuffer; }
27namespace cg { class TextureSetImageContainer; }
28namespace mce { class Color; }
29namespace mce { class FileWatcherHandle; }
30namespace mce { class TextureGroup; }
31namespace mce::framebuilder { struct PBRTextureDataManager; }
32// clang-format on
33
35public:
36 // TextureAtlas inner types define
37 using SourceImageBuffers = ::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>;
38
39 using TextureAtlasTiles = ::std::vector<::TextureAtlasTile>;
40
41 using StatusCallback = ::std::function<void(::TextureAtlasStatus const&)>;
42
43 using ImageAtlasFinishedCallback = ::std::function<void()> const;
44
45 using RuntimeImageGenerators = ::std::vector<::std::weak_ptr<::RuntimeImageGeneratorInfo>>;
46
47public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AtlasItemManager>> mAtlasItemManager;
51 ::ll::TypedStorage<8, 240, ::ParsedAtlasData> mParsedAtlasData;
52 ::ll::TypedStorage<4, 4, ::AtlasParameters> mAtlasParameters;
53 ::ll::TypedStorage<8, 16, ::std::set<::ResourceLocation>> mResources;
54 ::ll::TypedStorage<8, 64, ::ImageResourceManager> mResourceManager;
55 ::ll::TypedStorage<8, 24, ::std::vector<::mce::FileWatcherHandle>> mFileWatcherHandle;
56 ::ll::TypedStorage<8, 24, ::std::vector<::std::weak_ptr<::RuntimeImageGeneratorInfo>>> mRuntimeImageGenerators;
57 ::ll::TypedStorage<8, 88, ::cg::TextureAtlas> mTextureAtlas;
58 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager>>
59 mPBRTextureDataManager;
60 // NOLINTEND
61
62public:
63 // prevent constructor by default
64 TextureAtlas();
65
66public:
67 // virtual functions
68 // NOLINTBEGIN
69 virtual ~TextureAtlas() /*override*/;
70 // NOLINTEND
71
72public:
73 // member functions
74 // NOLINTBEGIN
75 MCAPI TextureAtlas(
76 ::ResourceLocation const& metaFile,
77 ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager> pbrTextureDataManager
78 );
79
80 MCAPI void _addElementCollection(
81 ::ResourcePackManager& resourcePackManager,
82 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
83 ::Json::Value const& texture,
84 ::ParsedAtlasNode& newNode,
85 int atIndex,
86 float mipFadeAmount,
87 ::mce::Color const& mipFadeColor,
88 bool isAdditive
89 );
90
91 MCAPI ::TextureAtlasTile* _addTile(
92 ::std::vector<::TextureAtlasTile>& textureAtlasTiles,
93 bool quad,
94 float fadePerMipAmount,
95 ::ParsedAtlasNodeElement& element
96 );
97
98 MCAPI ::TextureAtlasResourceCallbacks _createAtlas(
99 ::Json::Value const& root,
100 ::std::function<void(::TextureAtlasStatus const&)> statusCallback,
101 ::std::function<void()> imageAtlasFinishedCallback,
102 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
103 ::cg::MipMapSupport mipMapSupport,
104 ::ResourcePackManager& resourcePackManager,
105 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
106 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
107 outCopyOfSourceImages
108 );
109
110 MCAPI ::std::vector<::TextureAtlasTile> _generateAtlasTileList();
111
112 MCAPI void _loadAtlasNodes(
113 ::ResourcePackManager& resourcePackManager,
114 ::Json::Value const& root,
115 ::std::vector<::ParsedAtlasNode>& atlasNodes,
116 ::std::shared_ptr<::mce::TextureGroup> textureGroup
117 );
118
119 MCAPI void _loadRuntimeImageAtlasNodes(::std::vector<::ParsedAtlasNode>& atlasNodes);
120
121 MCAPI bool _readNode(
122 ::ResourcePackManager& resourcePackManager,
123 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
124 ::Json::Value const& jsonNode,
125 ::ParsedAtlasNode& node,
126 bool isRefreshing
127 );
128
129 MCAPI ::TextureAtlasResourceCallbacks createAtlasFromJson(
130 ::Json::Value const& json,
131 ::ResourcePackManager& resourcePackManager,
132 ::std::function<void(::TextureAtlasStatus const&)> statusCallback,
133 ::std::function<void()> imageAtlasFinishedCallback,
134 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
135 ::cg::MipMapSupport mipMapSupport,
136 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
137 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
138 outCopyOfSourceImages
139 );
140
141 MCAPI ::TextureAtlasResourceCallbacks createAtlasFromList(
142 ::std::string const& atlasName,
143 ::std::vector<::std::string> const& textures,
144 ::ResourcePackManager& resourcePackManager,
145 ::std::function<void(::TextureAtlasStatus const&)> statusCallback,
146 ::std::function<void()> imageAtlasFinishedCallback,
147 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
148 ::cg::MipMapSupport mipMapSupport,
149 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
150 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
151 outCopyOfSourceImages
152 );
153
154 MCAPI ::ResourceLocation const& getPathFromName(::std::string const& name) const;
155
156 MCAPI ::TextureAtlasResourceCallbacks loadMetaFile(
157 ::ResourcePackManager& resourcePackManager,
158 ::std::function<void(::TextureAtlasStatus const&)> statusCallback,
159 ::std::function<void()> imageAtlasFinishedCallback,
160 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
161 ::cg::MipMapSupport mipMapSupport,
162 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
163 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
164 outCopyOfSourceImages
165 );
166
167 MCAPI ::TextureAtlasResourceCallbacks recreateAtlas(
168 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
169 ::std::function<void(::TextureAtlasStatus const&)> statusCallback,
170 ::std::function<void()> imageAtlasFinishedCallback,
171 ::cg::MipMapSupport mipMapSupport,
172 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
173 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
174 outCopyOfSourceImages
175 );
176 // NOLINTEND
177
178public:
179 // constructor thunks
180 // NOLINTBEGIN
181 MCAPI void* $ctor(
182 ::ResourceLocation const& metaFile,
183 ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager> pbrTextureDataManager
184 );
185 // NOLINTEND
186
187public:
188 // destructor thunk
189 // NOLINTBEGIN
190 MCAPI void $dtor();
191 // NOLINTEND
192
193public:
194 // vftables
195 // NOLINTBEGIN
196 MCNAPI static void** $vftable();
197 // NOLINTEND
198};
Definition EnableNonOwnerReferences.h:7
Definition Value.h:16
Definition ResourcePackManager.h:29
Definition TextureAtlasTile.h:5
Definition TextureAtlas.h:5
static MCAPI void ** $vftable()
Definition ImageBuffer.h:16
Definition TextureSetImageContainer.h:20
Definition Color.h:13
Definition FileWatcherHandle.h:12
Definition TextureGroup.h:7
Definition AtlasItemManager.h:5
Definition ParsedAtlasNodeElement.h:5
Definition ParsedAtlasNode.h:5
Definition RuntimeImageGeneratorInfo.h:5
Definition TextureAtlasResourceCallbacks.h:5
Definition PBRTextureDataManager.h:7