LeviLamina
Loading...
Searching...
No Matches
SpriteComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/ClipDirection.h"
7#include "mc/client/gui/SliceSize.h"
8#include "mc/client/gui/TileDirection.h"
9#include "mc/client/gui/UITextureInfoPtr.h"
10#include "mc/client/gui/controls/RenderableComponent.h"
11#include "mc/client/gui/controls/UIMaterialType.h"
12#include "mc/deps/core/file/PathBuffer.h"
13#include "mc/deps/core/math/Color.h"
14#include "mc/deps/core/resource/ResourceLocation.h"
15#include "mc/deps/core_graphics/ImageDescription.h"
16#include "mc/deps/minecraft_renderer/renderer/TexturePtr.h"
17
18// auto generated forward declare list
19// clang-format off
20class UIComponent;
21class UIControl;
22class UIRenderContext;
23namespace Core { class PathView; }
24// clang-format on
25
27public:
28 // member variables
29 // NOLINTBEGIN
30 ::ll::TypedStorage<8, 56, ::ResourceLocation> mResourceLocation;
31 ::ll::TypedStorage<8, 96, ::UITextureInfoPtr> mUITextureInfo;
32 ::ll::TypedStorage<8, 96, ::UITextureInfoPtr> mBackCompatUITexture;
33 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mTexture;
34 ::ll::TypedStorage<4, 20, ::cg::ImageDescription> mCachedImageDescription;
35 ::ll::TypedStorage<4, 4, ::UIMaterialType> mUIMaterialType;
36 ::ll::TypedStorage<4, 8, ::glm::vec2> mUV;
37 ::ll::TypedStorage<4, 8, ::glm::vec2> mUVSize;
38 ::ll::TypedStorage<4, 16, ::mce::Color> mColor;
39 ::ll::TypedStorage<4, 16, ::ui::SliceSize> mNineSliceSize;
40 ::ll::TypedStorage<1, 1, ::ui::ClipDirection> mClipDirection;
41 ::ll::TypedStorage<4, 8, ::glm::vec2> mTiledScale;
42 ::ll::TypedStorage<4, 8, ::glm::vec2> mInvTextureSize;
43 ::ll::TypedStorage<4, 4, ::ui::TileDirection> mTiled;
44 ::ll::TypedStorage<4, 4, float> mClipRatio;
45 bool mClipPixelPerfect : 1;
46 bool mHasNineSlice : 1;
47 bool mPixelPerfect : 1;
48 bool mKeepRatio : 1;
49 bool mFilled : 1;
50 bool mEnableGrayscale : 1;
51 bool mEnableBilinear : 1;
52 bool mTriggerDebugLog : 1;
53 bool mForceReloadTexture : 1;
54 bool mTextureHasChanged : 1;
55 bool mAllowDebugTextureReplacement : 1;
56 bool mColorCorrected : 1;
57 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mZipFolder;
58 // NOLINTEND
59
60public:
61 // prevent constructor by default
62 SpriteComponent();
63
64public:
65 // virtual functions
66 // NOLINTBEGIN
67 virtual ~SpriteComponent() /*override*/;
68
69 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner) const /*override*/;
70
71 virtual void reset() /*override*/;
72 // NOLINTEND
73
74public:
75 // member functions
76 // NOLINTBEGIN
77 MCAPI explicit SpriteComponent(::UIControl& owner);
78
79 MCAPI void _drawClipped(
80 ::glm::vec2 const& pos,
81 ::glm::vec2 const& size,
82 ::glm::vec2 const& startUV,
83 ::glm::vec2 const& uvSize,
84 ::std::function<void(::glm::vec2 const&, ::glm::vec2 const&, ::glm::vec2 const&, ::glm::vec2 const&)> callback
85 ) const;
86
87 MCAPI void _drawFilled(
88 ::UIRenderContext& context,
89 ::glm::vec2 const& startPos,
90 ::glm::vec2 const& size,
91 ::glm::vec2 const& startUV,
92 ::glm::vec2 const& uvSize
93 ) const;
94
95 MCAPI void _drawKeepRatio(
96 ::UIRenderContext& context,
97 ::glm::vec2 const& startPos,
98 ::glm::vec2 const& size,
99 ::glm::vec2 const& startUV,
100 ::glm::vec2 const& uvSize
101 ) const;
102
103 MCAPI void _drawTiled(
104 ::glm::vec2 const& startPos,
105 ::glm::vec2 const& size,
106 ::glm::vec2 const& startUV,
107 ::glm::vec2 const& uvSize,
108 ::std::function<void(::glm::vec2 const&, ::glm::vec2 const&, ::glm::vec2 const&, ::glm::vec2 const&)> callback
109 ) const;
110
111 MCAPI void _drawTiledClipped(
112 ::glm::vec2 const& startPos,
113 ::glm::vec2 const& size,
114 ::glm::vec2 const& startUV,
115 ::glm::vec2 const& uvSize,
116 ::std::function<void(::glm::vec2 const&, ::glm::vec2 const&, ::glm::vec2 const&, ::glm::vec2 const&)> callback
117 );
118
119 MCAPI void
120 _getClippedInfo(::glm::vec2& clipPos, ::glm::vec2& clipSize, ::glm::vec2& clipUV, ::glm::vec2& clipUVSize) const;
121
122 MCAPI bool _handleTextureChange(::mce::TexturePtr const& texture);
123
124 MCAPI bool getBilinearEnabled() const;
125
126 MCAPI float getClipRatio() const;
127
128 MCFOLD ::mce::Color const& getColor() const;
129
130 MCFOLD ::ui::SliceSize const& getNineSliceSize() const;
131
132 MCFOLD ::ResourceLocation const& getResourceLocation() const;
133
134 MCFOLD ::mce::TexturePtr& getTexture();
135
136 MCAPI ::UIMaterialType getUIMaterialType() const;
137
138 MCFOLD ::glm::vec2 const& getUVSize() const;
139
140 MCFOLD ::Core::PathBuffer<::std::string> const& getZipFolder() const;
141
142 MCAPI void render(::UIRenderContext& context);
143
144 MCAPI void setBilinearEnabled(bool enabled);
145
146 MCAPI void setClipRatio(float clipRatio);
147
148 MCAPI void setColor(::mce::Color const& tint);
149
150 MCAPI void setGrayscaleEnabled(bool enabled);
151
152 MCAPI void setNineSliceSize(::ui::SliceSize const& sliceSize);
153
154 MCAPI void setResourceLocation(::ResourceLocation const& resourceLocation);
155
156 MCAPI void setUV(::glm::vec2 const& uv);
157
158 MCAPI void setUVSize(::glm::vec2 const& uvSize);
159
160 MCAPI void setZipFolder(::Core::PathView zipFolder);
161 // NOLINTEND
162
163public:
164 // constructor thunks
165 // NOLINTBEGIN
166 MCAPI void* $ctor(::UIControl& owner);
167 // NOLINTEND
168
169public:
170 // destructor thunk
171 // NOLINTBEGIN
172 MCAPI void $dtor();
173 // NOLINTEND
174
175public:
176 // virtual function thunks
177 // NOLINTBEGIN
178 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
179
180 MCFOLD void $reset();
181 // NOLINTEND
182
183public:
184 // vftables
185 // NOLINTBEGIN
186 MCNAPI static void** $vftable();
187 // NOLINTEND
188};
Definition PathView.h:19
Definition RenderableComponent.h:5
Definition SpriteComponent.h:5
static MCAPI void ** $vftable()
Definition UIComponent.h:5
Definition UIControl.h:5
Definition UIRenderContext.h:5