3#include "mc/_HeaderOutputPredefine.h"
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"
25namespace Json {
class Value; }
28namespace mce {
class Color; }
37 using SourceImageBuffers = ::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>;
39 using TextureAtlasTiles = ::std::vector<::TextureAtlasTile>;
41 using StatusCallback = ::std::function<void(::TextureAtlasStatus
const&)>;
43 using ImageAtlasFinishedCallback = ::std::function<void()>
const;
45 using RuntimeImageGenerators = ::std::vector<::std::weak_ptr<::RuntimeImageGeneratorInfo>>;
47 using SourceImagesSignature = void(::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>
const&);
52 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AtlasItemManager>> mAtlasItemManager;
53 ::ll::TypedStorage<8, 240, ::ParsedAtlasData> mParsedAtlasData;
54 ::ll::TypedStorage<4, 4, ::AtlasParameters> mAtlasParameters;
55 ::ll::TypedStorage<8, 16, ::std::set<::ResourceLocation>> mResources;
56 ::ll::TypedStorage<8, 64, ::ImageResourceManager> mResourceManager;
57 ::ll::TypedStorage<8, 24, ::std::vector<::mce::FileWatcherHandle>> mFileWatcherHandle;
58 ::ll::TypedStorage<8, 24, ::std::vector<::std::weak_ptr<::RuntimeImageGeneratorInfo>>> mRuntimeImageGenerators;
59 ::ll::TypedStorage<8, 88, ::cg::TextureAtlas> mTextureAtlas;
60 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager>>
61 mPBRTextureDataManager;
71 virtual ~TextureAtlas() ;
78 ::ResourceLocation
const& metaFile,
79 ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager> pbrTextureDataManager
82 MCAPI
void _addElementCollection(
83 ::ResourcePackManager& resourcePackManager,
84 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
85 ::Json::Value
const& texture,
86 ::ParsedAtlasNode& newNode,
89 ::mce::Color
const& mipFadeColor,
93 MCAPI ::TextureAtlasTile* _addTile(
94 ::std::vector<::TextureAtlasTile>& textureAtlasTiles,
96 float fadePerMipAmount,
97 ::ParsedAtlasNodeElement& element
100 MCAPI ::TextureAtlasResourceCallbacks _createAtlas(
101 ::Json::Value
const& root,
102 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
103 ::std::function<
void()> imageAtlasFinishedCallback,
104 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
105 ::cg::MipMapSupport mipMapSupport,
106 ::ResourcePackManager& resourcePackManager,
107 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
108 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
109 outCopyOfSourceImages
112 MCAPI ::std::vector<::TextureAtlasTile> _generateAtlasTileList();
114 MCAPI
void _loadAtlasNodes(
115 ::ResourcePackManager& resourcePackManager,
116 ::Json::Value
const& root,
117 ::std::vector<::ParsedAtlasNode>& atlasNodes,
118 ::std::shared_ptr<::mce::TextureGroup> textureGroup
121 MCAPI
void _loadRuntimeImageAtlasNodes(::std::vector<::ParsedAtlasNode>& atlasNodes);
123 MCAPI
bool _readNode(
124 ::ResourcePackManager& resourcePackManager,
125 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
126 ::Json::Value
const& jsonNode,
127 ::ParsedAtlasNode& node,
131 MCAPI ::TextureAtlasResourceCallbacks createAtlasFromJson(
132 ::Json::Value
const& json,
133 ::ResourcePackManager& resourcePackManager,
134 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
135 ::std::function<
void()> imageAtlasFinishedCallback,
136 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
137 ::cg::MipMapSupport mipMapSupport,
138 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
139 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
140 outCopyOfSourceImages
143 MCAPI ::TextureAtlasResourceCallbacks createAtlasFromList(
144 ::std::string
const& atlasName,
145 ::std::vector<::std::string>
const& textures,
146 ::ResourcePackManager& resourcePackManager,
147 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
148 ::std::function<
void()> imageAtlasFinishedCallback,
149 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
150 ::cg::MipMapSupport mipMapSupport,
151 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
152 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
153 outCopyOfSourceImages
156 MCAPI ::ResourceLocation
const& getPathFromName(::std::string
const& name)
const;
158 MCAPI ::TextureAtlasResourceCallbacks loadMetaFile(
159 ::ResourcePackManager& resourcePackManager,
160 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
161 ::std::function<
void()> imageAtlasFinishedCallback,
162 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
163 ::cg::MipMapSupport mipMapSupport,
164 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
165 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
166 outCopyOfSourceImages
169 MCAPI ::TextureAtlasResourceCallbacks recreateAtlas(
170 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
171 ::std::function<
void(::TextureAtlasStatus
const&)> statusCallback,
172 ::std::function<
void()> imageAtlasFinishedCallback,
173 ::cg::MipMapSupport mipMapSupport,
174 ::std::shared_ptr<::cg::ImageBuffer> outCopyOfFinalImage,
175 ::std::shared_ptr<::std::unordered_map<::ResourceLocation, ::cg::TextureSetImageContainer>>
176 outCopyOfSourceImages
184 ::ResourceLocation
const& metaFile,
185 ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager> pbrTextureDataManager
Definition AtlasItemManager.h:5
Definition EnableNonOwnerReferences.h:7
Definition ResourcePackManager.h:30
Definition TextureAtlasTile.h:5
Definition TextureAtlas.h:5
static MCAPI void ** $vftable()
Definition ImageBuffer.h:16
Definition TextureSetImageContainer.h:20
Definition FileWatcherHandle.h:12
Definition TextureGroup.h:7
Definition PBRTextureDataManager.h:7
Definition ParsedAtlasNodeElement.h:5
Definition ParsedAtlasNode.h:5
Definition RuntimeImageGeneratorInfo.h:5
Definition TextureAtlasResourceCallbacks.h:5