LeviLamina
Loading...
Searching...
No Matches
TextureSetDefinitionLoader.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/image/ImageFormat.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/deps/core_graphics/TextureSetLayerType.h"
9
10// auto generated forward declare list
11// clang-format off
14namespace cg { class CompressedImageBuffer; }
15namespace cg { class ImageBuffer; }
16namespace cg { class ImageResource; }
17namespace cg { class TextureSetDefinition; }
18namespace cg { class TextureSetLayerDefinition; }
19namespace mce { class ImageResourceLoader; }
20// clang-format on
21
22namespace TextureSetHelpers {
23
25public:
26 // TextureSetDefinitionLoader inner types declare
27 // clang-format off
28 class ResourceHelper;
29 // clang-format on
30
31 // TextureSetDefinitionLoader inner types define
32 enum class ColorPipeline : int {
33 Classic = 0,
34 Pbr = 1,
35 };
36
37 enum class LoadImageLayerResult : int {
38 Ok = 0,
39 NoFile = 1,
40 NoLayer = 2,
41 ErrorLoading = 3,
42 };
43
44 enum class LoadMode : int {
45 ExplicitDefinitionOnly = 0,
46 ImageDescription = 1,
47 AllLayers = 2,
48 };
49
51 public:
52 // member variables
53 // NOLINTBEGIN
54 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::ImageResourceLoader>> mImageResourceLoader;
55 // NOLINTEND
56
57 public:
58 // virtual functions
59 // NOLINTBEGIN
60#ifdef LL_PLAT_S
61 virtual ~ResourceHelper() = default;
62#else // LL_PLAT_C
63 virtual ~ResourceHelper();
64#endif
65
66#ifdef LL_PLAT_S
67 virtual ::ResourceLocation getBackCompatResourceLocation(::ResourceLocation const&) const;
68#else // LL_PLAT_C
69 virtual ::ResourceLocation getBackCompatResourceLocation(::ResourceLocation const& resourceLocation) const;
70#endif
71
72#ifdef LL_PLAT_S
73 virtual ::std::optional<uint> getPackStackIndexOfNoExtensionOrImage(::ResourceLocation const&) const;
74#else // LL_PLAT_C
75 virtual ::std::optional<uint>
76 getPackStackIndexOfNoExtensionOrImage(::ResourceLocation const& resourceLocation) const;
77#endif
78
79#ifdef LL_PLAT_S
80 virtual ::std::optional<uint> getPackStackIndexOfTextureSet(::ResourceLocation const&) const;
81#else // LL_PLAT_C
82 virtual ::std::optional<uint> getPackStackIndexOfTextureSet(::ResourceLocation const& resourceLocation) const;
83#endif
84
85#ifdef LL_PLAT_S
86 virtual bool
87 loadResourceOfExtensions(::ResourceLocationPair const&, ::std::string&, ::gsl::span<::std::string const>) const;
88#else // LL_PLAT_C
89 virtual bool loadResourceOfExtensions(
90 ::ResourceLocationPair const& resourceLocationPair,
91 ::std::string& resourceStream,
92 ::gsl::span<::std::string const> extensions
93 ) const;
94#endif
95
96#ifdef LL_PLAT_S
97 virtual bool loadResource(::ResourceLocation const&, ::std::string&) const;
98#else // LL_PLAT_C
99 virtual bool loadResource(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
100#endif
101
102#ifdef LL_PLAT_S
103 virtual bool loadImageResourceFromMemory(
104 ::std::shared_ptr<::cg::ImageResource>&,
105 ::std::string const&,
107 ::mce::ImageFormat const&
108 ) const;
109#else // LL_PLAT_C
110 virtual bool loadImageResourceFromMemory(
111 ::std::shared_ptr<::cg::ImageResource>& out,
112 ::std::string const& buffer,
113 ::ResourceLocationPair const& resourceLocationPair,
114 ::mce::ImageFormat const& desiredImageFormat
115 ) const;
116#endif
117
118#ifdef LL_PLAT_S
119 virtual bool loadCompressedImageFromMemory(::cg::CompressedImageBuffer&, ::std::string const&) const;
120#else // LL_PLAT_C
121 virtual bool loadCompressedImageFromMemory(::cg::CompressedImageBuffer& out, ::std::string const& buffer) const;
122#endif
123
124 // NOLINTEND
125
126 public:
127 // destructor thunk
128 // NOLINTBEGIN
129 MCAPI void $dtor();
130 // NOLINTEND
131
132 public:
133 // virtual function thunks
134 // NOLINTBEGIN
135#ifdef LL_PLAT_C
136 MCAPI ::ResourceLocation $getBackCompatResourceLocation(::ResourceLocation const& resourceLocation) const;
137
138 MCAPI ::std::optional<uint>
139 $getPackStackIndexOfNoExtensionOrImage(::ResourceLocation const& resourceLocation) const;
140
141 MCAPI ::std::optional<uint> $getPackStackIndexOfTextureSet(::ResourceLocation const& resourceLocation) const;
142
143 MCAPI bool $loadResourceOfExtensions(
144 ::ResourceLocationPair const& resourceLocationPair,
145 ::std::string& resourceStream,
146 ::gsl::span<::std::string const> extensions
147 ) const;
148
149 MCAPI bool $loadResource(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
150
151 MCAPI bool $loadImageResourceFromMemory(
152 ::std::shared_ptr<::cg::ImageResource>& out,
153 ::std::string const& buffer,
154 ::ResourceLocationPair const& resourceLocationPair,
155 ::mce::ImageFormat const& desiredImageFormat
156 ) const;
157
158 MCAPI bool $loadCompressedImageFromMemory(::cg::CompressedImageBuffer& out, ::std::string const& buffer) const;
159#endif
160
161
162 // NOLINTEND
163
164 public:
165 // vftables
166 // NOLINTBEGIN
167 MCNAPI static void** $vftable();
168 // NOLINTEND
169 };
170
171public:
172 // static functions
173 // NOLINTBEGIN
174#ifdef LL_PLAT_C
175 MCAPI static ::TextureSetHelpers::TextureSetDefinitionLoader::LoadImageLayerResult _addImageToLayer(
176 ::std::shared_ptr<::cg::TextureSetDefinition> textureSetDefinition,
177 ::cg::TextureSetLayerType layerType,
178 ::ResourceLocationPair const& resourceLocationPair,
180 );
181
182 MCAPI static ::TextureSetHelpers::TextureSetDefinitionLoader::LoadImageLayerResult _loadImageLayer(
183 ::std::shared_ptr<::cg::TextureSetDefinition> textureSetDefinition,
184 ::Bedrock::NotNullNonOwnerPtr<::cg::TextureSetLayerDefinition const> layer,
186 );
187
188 MCAPI static ::TextureSetHelpers::TextureSetDefinitionLoader::LoadImageLayerResult _loadImageLayer(
189 ::std::shared_ptr<::cg::TextureSetDefinition> textureSetDefinition,
190 ::cg::TextureSetLayerType layerType,
192 );
193
194 MCAPI static bool _loadImageLayers(
195 ::ResourceLocation const& textureSetDefinition,
196 ::std::shared_ptr<::cg::TextureSetDefinition> loadMode,
197 ::TextureSetHelpers::TextureSetDefinitionLoader::LoadMode const& resourceHelper,
198 ::TextureSetHelpers::TextureSetDefinitionLoader::ColorPipeline const&,
200 );
201
202 MCAPI static ::std::shared_ptr<::cg::TextureSetDefinition> loadOrCreateTextureSetDefinition(
203 ::ResourceLocation const& resourceLocation,
204 ::TextureSetHelpers::TextureSetDefinitionLoader::LoadMode const& loadMode,
205 ::TextureSetHelpers::TextureSetDefinitionLoader::ColorPipeline const& colorMode,
206 ::cg::ImageBuffer const& missingImage,
208 bool needsDecompression
209 );
210
211 MCAPI static ::std::shared_ptr<::cg::TextureSetDefinition> loadOrCreateTextureSetDefinition(
212 ::ResourceLocationPair const& resourceLocationPair,
213 ::TextureSetHelpers::TextureSetDefinitionLoader::LoadMode const& loadMode,
214 ::TextureSetHelpers::TextureSetDefinitionLoader::ColorPipeline const& colorMode,
215 ::cg::ImageBuffer const* optionalMissingImage,
217 bool needsDecompression
218 );
219
220 MCAPI static ::std::shared_ptr<::cg::TextureSetDefinition> makeDefinitionFromImageBuffer(
221 ::ResourceLocationPair const& resourceLocationPair,
222 ::cg::ImageBuffer const* optionalImageBuffer,
223 bool isMissingTexture,
224 bool needsDecompression
225 );
226#endif
227 // NOLINTEND
228};
229
230} // namespace TextureSetHelpers
Definition ResourceLocationPair.h:9
Definition ResourceLocation.h:15
Definition TextureSetDefinitionLoader.h:50
Definition TextureSetDefinitionLoader.h:24
Definition CompressedImageBuffer.h:11
Definition ImageBuffer.h:16
Definition ImageResource.h:12
Definition TextureSetDefinition.h:20
Definition TextureSetLayerDefinition.h:14
Definition ImageResourceLoader.h:18
Definition buffer.h:5