3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/FontHandle.h"
7#include "mc/client/gui/TextAlignment.h"
8#include "mc/client/gui/controls/UIRenderContext.h"
9#include "mc/client/gui/screens/BatchKey.h"
10#include "mc/client/renderer/screen/MinecraftUIMeasureStrategy.h"
11#include "mc/deps/core/math/Color.h"
12#include "mc/deps/core/utility/NonOwnerPointer.h"
13#include "mc/deps/input/RectangleArea.h"
14#include "mc/deps/minecraft_renderer/renderer/MaterialPtr.h"
15#include "mc/deps/minecraft_renderer/renderer/Mesh.h"
33namespace Core {
class Path; }
53 ::ll::TypedStorage<8, 8, ::Font&> mFont;
54 ::ll::TypedStorage<4, 16, ::RectangleArea> mArea;
55 ::ll::TypedStorage<8, 32, ::std::string> mText;
56 ::ll::TypedStorage<4, 16, ::mce::Color> mColor;
57 ::ll::TypedStorage<1, 1, bool> mShadow;
58 ::ll::TypedStorage<1, 1, bool> mShowColorSymbol;
59 ::ll::TypedStorage<4, 4, int> mCaretLocation;
60 ::ll::TypedStorage<4, 4, float> mFontScale;
61 ::ll::TypedStorage<4, 4, float> mLinePadding;
62 ::ll::TypedStorage<4, 4, ::ui::TextAlignment> mAlignment;
67 TextItem& operator=(TextItem
const&);
68 TextItem(TextItem
const&);
76 ::ll::TypedStorage<8, 8, ::mce::ClientTexture const&> mTexture;
77 ::ll::TypedStorage<4, 8, ::glm::vec2> mPosition;
78 ::ll::TypedStorage<4, 8, ::glm::vec2> mSize;
79 ::ll::TypedStorage<4, 8, ::glm::vec2> mUV;
80 ::ll::TypedStorage<4, 8, ::glm::vec2> mUVSize;
81 ::ll::TypedStorage<1, 1, bool> mColorCorrected;
86 ImageItem& operator=(ImageItem
const&);
87 ImageItem(ImageItem
const&);
95 ::ll::TypedStorage<8, 176, ::BatchKey> mFromBatchKey;
96 ::ll::TypedStorage<8, 24, ::std::vector<::mce::TexturePtr>> mTextures;
97 ::ll::TypedStorage<4, 4, uint> mNumInstances;
98 ::ll::TypedStorage<4, 4, int> mKeepAlive;
99 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMaterial;
100 ::ll::TypedStorage<8, 552, ::mce::Mesh> mMesh;
105 PersistentMeshItem();
110 MCAPI PersistentMeshItem(
111 ::BatchKey
const& batchKey,
112 ::std::vector<::mce::TexturePtr> textures,
113 ::HashedString
const& materialNameHash,
117 MCAPI ~PersistentMeshItem();
124 ::BatchKey
const& batchKey,
125 ::std::vector<::mce::TexturePtr> textures,
126 ::HashedString
const& materialNameHash,
141 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClient;
142 ::ll::TypedStorage<8, 8, ::ScreenContext&> mScreenContext;
143 ::ll::TypedStorage<8, 32, ::MinecraftUIMeasureStrategy> mMeasureStrategy;
144 ::ll::TypedStorage<4, 4, float> mTextAlpha;
145 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IUIRepository>> mUIRepository;
146 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::TextureGroup>> mTextureGroup;
147 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::mce::TextureGroup>> mStoreCacheTextures;
148 ::ll::TypedStorage<8, 24, ::std::vector<::MinecraftUIRenderContext::TextItem>> mTextToDraw;
149 ::ll::TypedStorage<8, 24, ::std::vector<::MinecraftUIRenderContext::ImageItem>> mImagesToDraw;
150 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::MinecraftUIRenderContext::PersistentMeshItem>>>
152 ::ll::TypedStorage<1, 1, uchar> mStencilRef;
153 ::ll::TypedStorage<4, 4, int> mCurrentPersistentMeshItemIdx;
154 ::ll::TypedStorage<8, 80, ::FontHandle> mDebugTextFontHandle;
155 ::ll::TypedStorage<8, 8, ::UIScene const&> mCurrentScene;
156 ::ll::TypedStorage<4, 20, ::std::optional<::glm::vec4>> mSavedOriginalClippingRectangle;
161 MinecraftUIRenderContext& operator=(MinecraftUIRenderContext
const&);
162 MinecraftUIRenderContext(MinecraftUIRenderContext
const&);
163 MinecraftUIRenderContext();
168 virtual ~MinecraftUIRenderContext() ;
170 virtual int getLineLength(::Font& font, ::std::string
const& text,
float fontSize,
bool showColorSymbol)
const
173 virtual float getTextAlpha() const ;
175 virtual
void setTextAlpha(
float alpha) ;
177 virtual
void drawDebugText(
178 ::RectangleArea const& rect,
179 ::std::
string&& text,
180 ::mce::Color const& color,
182 ::ui::TextAlignment alignment,
183 ::TextMeasureData const& textData,
184 ::CaretMeasureData const& caretData
187 virtual
void drawText(
189 ::RectangleArea const& rect,
190 ::std::
string&& text,
191 ::mce::Color const& color,
193 ::ui::TextAlignment alignment,
194 ::TextMeasureData const& textData,
195 ::CaretMeasureData const& caretData
198 virtual
void flushText(
float deltaTime, ::std::optional<
float> obfuscateSwitchTime) ;
200 virtual
void drawImage(
201 ::mce::ClientTexture const& texture,
202 ::glm::vec2 const& position,
203 ::glm::vec2 const& size,
204 ::glm::vec2 const& uv,
205 ::glm::vec2 const& uvSize,
206 bool const colorCorrected
209 virtual
void drawNineslice(::mce::ClientTexture const& texture, ::NinesliceInfo const& info) ;
212 flushImages(::mce::Color const& color,
float alpha, ::HashedString const& materialNameHash) ;
214 virtual ::mce::TexturePtr getTexture(::ResourceLocation const& resourceLocation,
bool forceReload) const
217 virtual ::mce::TexturePtr getZippedTexture(
218 ::Core::Path const& zippedFolderPath,
219 ::ResourceLocation const& resourceLocation,
223 virtual
bool unloadTexture(::ResourceLocation const& resourceLocation) ;
225 virtual ::UITextureInfoPtr getUITextureInfo(::ResourceLocation const& resourceLocation,
bool forceReload) const
228 virtual
void touchTexture(::ResourceLocation const& resourceLocation) ;
230 virtual
void beginSharedMeshBatch(::ComponentRenderBatch& renderBatch) ;
232 virtual
void endSharedMeshBatch(::ComponentRenderBatch& renderBatch) ;
234 virtual
void reserveSharedMeshBatch(uint64 vertexCount) ;
236 virtual uint64 getSharedMeshBatchVertexCount() const ;
239 drawRectangle(::RectangleArea const& rect, ::mce::Color const& color,
float alpha,
int thickness) ;
241 virtual
void fillRectangle(::RectangleArea const& rect, ::mce::Color const& color,
float alpha) ;
243 virtual
void increaseStencilRef() ;
245 virtual
void decreaseStencilRef() ;
247 virtual
void resetStencilRef() ;
249 virtual
void fillRectangleStencil(::RectangleArea const& rect) ;
251 virtual
void enableScissorTest(::RectangleArea const& rect) ;
253 virtual
void disableScissorTest() ;
255 virtual
void setClippingRectangle(::RectangleArea const& rect) ;
257 virtual
void setFullClippingRectangle() ;
259 virtual
void saveCurrentClippingRectangle() ;
261 virtual
void restoreSavedClippingRectangle() ;
263 virtual ::RectangleArea getFullClippingRectangle() const ;
265 virtual
void cleanup() ;
267 virtual
void removePersistentMeshes() ;
269 virtual ::UIMeasureStrategy& getMeasureStrategy() ;
271 virtual
void snapImageSizeToGrid(::glm::vec2& size) const ;
273 virtual
void snapImagePositionToGrid(::glm::vec2& position) const ;
275 virtual
void notifyImageEstimate(uint64 imageCount) ;
277 virtual
bool updateCustom(::gsl::not_null<::CustomRenderComponent*> customRenderer) ;
279 virtual
void renderCustom(::gsl::not_null<::CustomRenderComponent*> customRenderer,
int pass) ;
286 MinecraftUIRenderContext(::IClientInstance& client, ::ScreenContext& screenContext, ::UIScene const& currentScene);
288 MCAPI
float _getTextAlignmentOffset(::MinecraftUIRenderContext::
TextItem const& textItem,
float lineLength) const;
290 MCAPI
float _getTextAlignmentPosition(::MinecraftUIRenderContext::
TextItem const& textItem) const;
293 _renderTextAligned(::MinecraftUIRenderContext::
TextItem const& textItem,
float tx,
float ty,
bool forceUseCache);
296 _splitTextItemText(::MinecraftUIRenderContext::
TextItem const& textItem, ::std::vector<::std::
string>& lines) const;
298 MCFOLD ::ScreenContext& getScreenContext();
304 MCAPI
void* $ctor(::IClientInstance& client, ::ScreenContext& screenContext, ::UIScene const& currentScene);
316 MCAPI
int $getLineLength(::Font& font, ::std::
string const& text,
float fontSize,
bool showColorSymbol) const;
318 MCFOLD
float $getTextAlpha() const;
320 MCFOLD
void $setTextAlpha(
float alpha);
322 MCAPI
void $drawDebugText(
323 ::RectangleArea const& rect,
324 ::std::
string&& text,
325 ::mce::Color const& color,
327 ::ui::TextAlignment alignment,
328 ::TextMeasureData const& textData,
329 ::CaretMeasureData const& caretData
332 MCAPI
void $drawText(
334 ::RectangleArea const& rect,
335 ::std::
string&& text,
336 ::mce::Color const& color,
338 ::ui::TextAlignment alignment,
339 ::TextMeasureData const& textData,
340 ::CaretMeasureData const& caretData
343 MCAPI
void $flushText(
float deltaTime, ::std::optional<
float> obfuscateSwitchTime);
345 MCAPI
void $drawImage(
346 ::mce::ClientTexture const& texture,
347 ::glm::vec2 const& position,
348 ::glm::vec2 const& size,
349 ::glm::vec2 const& uv,
350 ::glm::vec2 const& uvSize,
351 bool const colorCorrected
354 MCAPI
void $drawNineslice(::mce::ClientTexture const& texture, ::NinesliceInfo const& info);
356 MCAPI
void $flushImages(::mce::Color const& color,
float alpha, ::HashedString const& materialNameHash);
358 MCAPI ::mce::TexturePtr $getTexture(::ResourceLocation const& resourceLocation,
bool forceReload) const;
360 MCAPI ::mce::TexturePtr $getZippedTexture(
361 ::Core::Path const& zippedFolderPath,
362 ::ResourceLocation const& resourceLocation,
366 MCAPI
bool $unloadTexture(::ResourceLocation const& resourceLocation);
368 MCAPI ::UITextureInfoPtr $getUITextureInfo(::ResourceLocation const& resourceLocation,
bool forceReload) const;
370 MCAPI
void $touchTexture(::ResourceLocation const& resourceLocation);
372 MCAPI
void $beginSharedMeshBatch(::ComponentRenderBatch& renderBatch);
374 MCAPI
void $endSharedMeshBatch(::ComponentRenderBatch& renderBatch);
376 MCAPI
void $reserveSharedMeshBatch(uint64 vertexCount);
378 MCAPI uint64 $getSharedMeshBatchVertexCount() const;
380 MCAPI
void $drawRectangle(::RectangleArea const& rect, ::mce::Color const& color,
float alpha,
int thickness);
382 MCAPI
void $fillRectangle(::RectangleArea const& rect, ::mce::Color const& color,
float alpha);
384 MCAPI
void $increaseStencilRef();
386 MCAPI
void $decreaseStencilRef();
388 MCAPI
void $resetStencilRef();
390 MCAPI
void $fillRectangleStencil(::RectangleArea const& rect);
392 MCAPI
void $enableScissorTest(::RectangleArea const& rect);
394 MCAPI
void $disableScissorTest();
396 MCAPI
void $setClippingRectangle(::RectangleArea const& rect);
398 MCAPI
void $setFullClippingRectangle();
400 MCAPI
void $saveCurrentClippingRectangle();
402 MCAPI
void $restoreSavedClippingRectangle();
404 MCAPI ::RectangleArea $getFullClippingRectangle() const;
406 MCAPI
void $cleanup();
408 MCAPI
void $removePersistentMeshes();
410 MCFOLD ::UIMeasureStrategy& $getMeasureStrategy();
412 MCAPI
void $snapImageSizeToGrid(::glm::vec2& size) const;
414 MCAPI
void $snapImagePositionToGrid(::glm::vec2& position) const;
416 MCAPI
void $notifyImageEstimate(uint64 imageCount);
418 MCAPI
bool $updateCustom(::gsl::not_null<::CustomRenderComponent*> customRenderer);
420 MCAPI
void $renderCustom(::gsl::not_null<::CustomRenderComponent*> customRenderer,
int pass);
Definition ComponentRenderBatch.h:5
Definition CustomRenderComponent.h:5
Definition HashedString.h:5
Definition IClientInstance.h:5
Definition IUIRepository.h:5
Definition MinecraftUIRenderContext.h:5
static MCAPI void ** $vftable()
Definition ResourceLocation.h:15
Definition ScreenContext.h:5
Definition UIMeasureStrategy.h:5
Definition UIRenderContext.h:5
Definition UITextureInfoPtr.h:5
Definition TextureGroup.h:7
Definition TexturePtr.h:7
Definition CaretMeasureData.h:5
Definition MinecraftUIRenderContext.h:17
Definition MinecraftUIRenderContext.h:19
Definition MinecraftUIRenderContext.h:15
Definition NinesliceInfo.h:5
Definition TextMeasureData.h:5
Definition ClientTexture.h:7