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