43 using LoadResult = ::Bedrock::Threading::Async<void>;
45 using TextureMap = ::std::map<::ResourceLocation, ::BedrockTexture>;
47 using TextureLoadKey = ::std::pair<::ResourceLocation, ::TextureLoadMode>;
52 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IAdvancedGraphicsOptions>> mAdvancedGraphicsOptions;
53 ::ll::TypedStorage<8, 352, ::AsyncCachedTextureLoader> mAsyncTextureLoader;
54 ::ll::TypedStorage<8, 16, ::std::map<::ResourceLocation, ::BedrockTexture>> mLoadedTextures;
55 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager>> mResourceLoadManager;
56 ::ll::TypedStorage<8, 8, ::mce::TextureResourceService&> mResourceService;
57 ::ll::TypedStorage<8, 48, ::cg::ImageBuffer const> mMissingTexture;
58 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::ImageResourceLoader>> mImageResourceLoader;
59 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextureSetHelpers::TextureSetDefinitionLoader::ResourceHelper>>
60 mTextureSetResourceHelper;
61 ::ll::TypedStorage<8, 16, ::std::map<::ResourceLocation, ::std::optional<uint>>> mTouchedTextures;
62 ::ll::TypedStorage<8, 16, ::ImageBufferResourceManager> mImageBufferCache;
63 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::mce::LRUCache>> mLRUCache;
67 ::std::map<::std::pair<::ResourceLocation, ::TextureLoadMode>, ::Bedrock::Threading::SharedAsync<void>>>
69 ::ll::TypedStorage<8, 16, ::Bedrock::Threading::Async<void>> mQueueLoadResultCoroutine;
70 ::ll::TypedStorage<8, 16, ::Bedrock::Threading::CountTracker> mPendingLoadTaskCounter;
71 ::ll::TypedStorage<8, 8, ::std::atomic<uint64>> mOutstandingTaskMemory;
72 ::ll::TypedStorage<8, 8, ::std::atomic<uint64>> mOutstandingTaskCount;
86 virtual ::mce::TexturePtr getTexture(
87 ::ResourceLocation
const& resourceLocation,
88 bool const forceReload,
89 ::std::optional<uint> optLoadOrder,
90 ::cg::TextureSetLayerType
const textureType
98 ::Bedrock::NotNullNonOwnerPtr<::IAdvancedGraphicsOptions> advancedGraphicsOptions,
99 ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager,
104 ::Bedrock::NotNullNonOwnerPtr<::IAdvancedGraphicsOptions> advancedGraphicsOptions,
105 ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager,
107 ::std::shared_ptr<::mce::ImageResourceLoader> imageResourceLoader
110 MCAPI
void _loadTextureAsyncUrgentlyIfTouched(
111 ::std::pair<::ResourceLocation, ::TextureLoadMode>
const& textureLoadKey,
112 ::std::optional<::ResourceLoadType> optionalLoadType
115 MCAPI
void _loadTexturesAsync(
116 ::gsl::span<::ResourceLocationPair> locationPairs,
117 ::std::optional<::ResourceLoadType> resourceLoadType
120 MCAPI
void _loadTexturesSync(::gsl::span<::ResourceLocation> locations);
122 MCAPI
bool _textureIsQueuedOrBeingLoaded(::std::pair<::ResourceLocation, ::TextureLoadMode>
const& textureLoadKey);
124 MCAPI
void _unloadBedrockTextureAndCachedImage(
125 ::ResourceLocation
const& cachedResourceLocation,
129 MCAPI
void _unloadFileSystem(::ResourceFileSystem fileSystem);
131 MCAPI
void addEmptyTexture(::ResourceLocation
const& resourceLocation,
int width,
int height);
133 MCAPI uint64 estimateMemoryUsage()
const;
135 MCAPI ::BedrockTextureData
const* getBedrockTextureData(::ResourceLocation
const& resourceLocation)
const;
137 MCAPI ::cg::ImageBuffer* getCachedImage(::ResourceLocation
const& resourceLocation)
const;
139 MCAPI ::cg::ImageBuffer* getCachedImageOrLoadAsync(::ResourceLocation
const& imageToLoad);
141 MCAPI ::cg::ImageBuffer* getCachedImageOrLoadSync(::ResourceLocation
const& resourceLocation,
bool forceReload);
144 ::ResourceLocation
const& resourceLocation,
146 ::cg::TextureSetLayerType textureType
149 MCAPI ::nonstd::expected<void, ::std::error_condition>
150 loadImageSyncAndInsertIntoCache(::ResourceLocation
const& resourceLocation,
bool splitAsArray);
152 MCAPI ::Bedrock::Threading::Async<void> loadTextureAsync(
153 ::ResourceLocation
const& resourceLocation,
154 ::TextureLoadMode textureLoadMode,
155 ::std::optional<::ResourceLoadType> resourceLoadType,
156 ::std::optional<uint> optLoadOrder
160 loadTexturesAsync(::gsl::span<::ResourceLocation> locations, ::std::optional<::ResourceLoadType> resourceLoadType);
162 MCAPI
void reloadAllTextures();
164 MCAPI
void reloadImages(
165 ::gsl::span<::ResourceLocationPair> imagesToLoadAsync,
166 ::gsl::span<::ResourceLocation> imagesToImmediatelyLoad,
167 ::std::vector<::ResourceLocation> texturesToKeep,
171 MCAPI
bool shouldLoadPBRResources()
const;
173 MCAPI
void unloadAllTextures();
175 MCAPI ::BedrockTexture& uploadTexture(::ResourceLocation
const& resourceLocation, ::cg::ImageBuffer imageBuffer);
177 MCAPI ::BedrockTexture& uploadTexture(
178 ::ResourceLocation
const& resourceLocation,
179 ::gsl::not_null<::std::shared_ptr<::cg::TextureSetDefinition>> textureSetDefinition
182 MCAPI ::BedrockTexture& uploadTexture(
183 ::ResourceLocation
const& resourceLocation,
185 ::std::string_view optionalIdentifier
193 ::Bedrock::NotNullNonOwnerPtr<::IAdvancedGraphicsOptions> advancedGraphicsOptions,
194 ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager,
199 ::Bedrock::NotNullNonOwnerPtr<::IAdvancedGraphicsOptions> advancedGraphicsOptions,
200 ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager,
202 ::std::shared_ptr<::mce::ImageResourceLoader> imageResourceLoader
215 MCAPI ::mce::TexturePtr $getTexture(
216 ::ResourceLocation
const& resourceLocation,
217 bool const forceReload,
218 ::std::optional<uint> optLoadOrder,
219 ::cg::TextureSetLayerType
const textureType