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>>;
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;
69 virtual ~TextureAtlas() ;
76 ::ResourceLocation
const& metaFile,
77 ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager> pbrTextureDataManager
80 MCAPI
void _addElementCollection(
81 ::ResourcePackManager& resourcePackManager,
82 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
83 ::Json::Value
const& texture,
84 ::ParsedAtlasNode& newNode,
87 ::mce::Color
const& mipFadeColor,
91 MCAPI ::TextureAtlasTile* _addTile(
92 ::std::vector<::TextureAtlasTile>& textureAtlasTiles,
94 float fadePerMipAmount,
95 ::ParsedAtlasNodeElement& element
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
110 MCAPI ::std::vector<::TextureAtlasTile> _generateAtlasTileList();
112 MCAPI
void _loadAtlasNodes(
113 ::ResourcePackManager& resourcePackManager,
114 ::Json::Value
const& root,
115 ::std::vector<::ParsedAtlasNode>& atlasNodes,
116 ::std::shared_ptr<::mce::TextureGroup> textureGroup
119 MCAPI
void _loadRuntimeImageAtlasNodes(::std::vector<::ParsedAtlasNode>& atlasNodes);
121 MCAPI
bool _readNode(
122 ::ResourcePackManager& resourcePackManager,
123 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
124 ::Json::Value
const& jsonNode,
125 ::ParsedAtlasNode& node,
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
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
154 MCAPI ::ResourceLocation
const& getPathFromName(::std::string
const& name)
const;
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
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
182 ::ResourceLocation
const& metaFile,
183 ::Bedrock::NonOwnerPointer<::mce::framebuilder::PBRTextureDataManager> pbrTextureDataManager
Definition EnableNonOwnerReferences.h:7
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 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