LeviLamina
Loading...
Searching...
No Matches
ItemRenderer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/renderer/actor/ActorRenderer.h"
7#include "mc/client/renderer/actor/IconBlitGlint.h"
8#include "mc/client/renderer/actor/ItemRenderChunkType.h"
9#include "mc/deps/minecraft_renderer/renderer/MaterialPtr.h"
10#include "mc/deps/renderer/MatrixStack.h"
11#include "mc/world/level/block/BlockShape.h"
12
13// auto generated forward declare list
14// clang-format off
15class ActorRenderData;
18class Block;
19class BlockGraphics;
21class BlockType;
24class ItemActor;
25class ItemGraphics;
26class ItemStack;
27class Matrix;
28class SkullBlockActor;
29class Vec3;
31namespace dragon { struct RenderMetadata; }
32namespace mce { class TextureGroup; }
33namespace mce { class TexturePtr; }
34// clang-format on
35
36class ItemRenderer : public ::ActorRenderer {
37public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockTessellator>> mBlockTessellator;
41 ::ll::TypedStorage<4, 64, float[16]> mRandomFloats;
42 ::ll::TypedStorage<8, 64, ::std::unordered_map<short, ::ItemGraphics>> mItemGraphics;
43 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mUIBlitMaterial;
44 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mUIIconBlitMaterial;
45 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mUIIconBlitMaterialMultiColorTint;
46 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mUIIconUnblitMaterial;
47 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mUIIconBlitGlintMaterial;
48 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mEntityAlphatestChangeColorMaterial;
49 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mEntityAlphatestChangeColorGlintMaterial;
50 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mEntityAlphatestMultiColorTintMaterial;
51 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BannerBlockActor>> mBannerEntity;
52 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DecoratedPotBlockActor>> mDecoratedPotBlockEntity;
53 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SkullBlockActor>> mSkullEntity;
54 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ConduitBlockActor>> mConduitEntity;
55 ::ll::TypedStorage<1, 1, bool> mSupportsNewVertexFormat;
56 // NOLINTEND
57
58public:
59 // prevent constructor by default
60 ItemRenderer();
61
62public:
63 // virtual functions
64 // NOLINTBEGIN
65 virtual ~ItemRenderer() /*override*/;
66
67 virtual void render(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData) /*override*/;
68 // NOLINTEND
69
70public:
71 // member functions
72 // NOLINTBEGIN
73 MCAPI ItemRenderer(::std::shared_ptr<::mce::TextureGroup> textureGroup, bool supportsNewVertexFormat);
74
75 MCAPI void _applyBlockItemTransforms(
76 ::MatrixStack::MatrixStackRef& worldMatrix,
77 ::BlockType const* blockType,
78 ::Block const* block,
79 ::BlockShape shape,
80 float& scaleValue,
81 bool isInItemFrame
82 ) const;
83
84 MCAPI ::Matrix
85 _getGuiBlockItemTransforms(::Block const* block, ::Vec3 offset, float scale, float squeezeAmount) const;
86
87 MCAPI void _getGuiItemColors(::ItemStack const& item, int& color, int& secondaryColor) const;
88
89 MCAPI ::IconBlitGlint _getIconBlitGlint(::ItemRenderChunkType itemRenderChunkType, ::ItemStack const& item) const;
90
91 MCAPI ::mce::TexturePtr _getShulkerBoxTexture(::ItemStack const& item);
92
93 MCAPI void _renderBannerItem(
94 ::BaseActorRenderContext& renderContext,
95 ::ItemStack const& item,
96 ::ItemActor& itemEntity,
97 bool isItem,
98 float actorFrameAlpha
99 );
100
101 MCAPI void _renderBlockItem(
102 ::BaseActorRenderContext& renderContext,
103 ::ItemStack const& item,
104 ::ItemActor& itemEntity,
105 ::BlockType const* blockType,
106 ::BlockShape shape,
107 float actorFrameAlpha,
108 int count
109 );
110
111 MCAPI void _renderDecoratedPotItem(
112 ::BaseActorRenderContext& renderContext,
113 ::ItemStack const& item,
114 ::ItemActor& itemEntity,
115 bool isItem
116 );
117
118 MCAPI void _renderGuiBlockTypeItem(
119 ::BaseActorRenderContext& renderContext,
120 ::ItemStack const& item,
121 ::BlockGraphics const* blockGraphics,
122 ::mce::TexturePtr const& texture,
123 float x,
124 float y,
125 float lightMultiplier,
126 float alphaMultiplier,
127 float scale,
128 float pickupPopPercentage,
129 float squeezeAmount
130 );
131
132 MCAPI void _renderGuiDataDrivenBlockItem(
133 ::BaseActorRenderContext& renderContext,
134 ::Block const* block,
135 float x,
136 float y,
137 float scale,
138 float squeezeAmount,
139 int zOrder
140 );
141
142 MCAPI bool _renderGuiEntityBlockItem(
143 ::BaseActorRenderContext& renderContext,
144 ::ItemRenderChunkType itemRenderChunkType,
145 ::dragon::RenderMetadata renderMetadata,
146 ::ItemStack const& item,
147 float x,
148 float y,
149 float lightMultiplier,
150 float scale
151 );
152
153 MCAPI void _renderGuiGlowStickItem(
154 ::BaseActorRenderContext& renderContext,
155 ::ItemStack const& item,
156 float x,
157 float y,
158 float lightMultiplier,
159 float scale,
160 float pickupPopPercentage,
161 float squeezeAmount
162 );
163
164 MCAPI void _renderItemGroup(
165 ::BaseActorRenderContext& renderContext,
166 ::ItemActor& itemEntity,
167 int itemCount,
168 float scaleValue,
169 float frameAlpha,
170 bool useMatrixAsIs
171 ) const;
172
173 MCAPI void _renderShieldItem(
174 ::BaseActorRenderContext& renderContext,
175 ::ItemStack const& item,
176 ::ItemActor& itemEntity,
177 float actorFrameAlpha
178 );
179
180 MCAPI void forceGraphicsLoad();
181
182 MCAPI ::ItemGraphics& getGraphics(::ItemStack const& item);
183
184 MCAPI void iconBlit(
185 ::BaseActorRenderContext& renderContext,
186 ::mce::TexturePtr const& texture,
187 float x,
188 float y,
189 float z,
190 ::TextureUVCoordinateSet const& iconTextureCoord,
191 float w,
192 float h,
193 float lightMultiplier,
194 float alphaMultiplier,
195 int colorMultiplier,
196 int secondaryColorMultiplier,
197 float xscale,
198 float yscale,
199 ::IconBlitGlint iconBlitGlint,
200 bool useMultiColorTextureTinting
201 );
202
203 MCAPI void renderGuiItemInChunk(
204 ::BaseActorRenderContext& renderContext,
205 ::ItemRenderChunkType itemRenderChunkType,
206 ::ItemStack const& item,
207 float x,
208 float y,
209 float lightMultiplier,
210 float alphaMultiplier,
211 float scale,
212 int frame,
213 bool allowAnimation,
214 int zOrder,
215 ::std::optional<::TextureUVCoordinateSet> const& customIconUVCoords
216 );
217
218 MCAPI void renderGuiItemNew(
219 ::BaseActorRenderContext& renderContext,
220 ::ItemStack const& item,
221 int frame,
222 float x,
223 float y,
224 bool renderEnchantmentFoil,
225 float transparency,
226 float lightMultiplier,
227 float scale,
228 int zOrder
229 );
230 // NOLINTEND
231
232public:
233 // constructor thunks
234 // NOLINTBEGIN
235 MCAPI void* $ctor(::std::shared_ptr<::mce::TextureGroup> textureGroup, bool supportsNewVertexFormat);
236 // NOLINTEND
237
238public:
239 // destructor thunk
240 // NOLINTBEGIN
241 MCAPI void $dtor();
242 // NOLINTEND
243
244public:
245 // virtual function thunks
246 // NOLINTBEGIN
247 MCAPI void $render(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
248 // NOLINTEND
249
250public:
251 // vftables
252 // NOLINTBEGIN
253 MCNAPI static void** $vftable();
254 // NOLINTEND
255};
Definition ActorRenderData.h:5
Definition ActorRenderer.h:5
Definition BannerBlockActor.h:22
Definition BaseActorRenderContext.h:5
Definition BlockGraphics.h:5
Definition BlockTessellator.h:5
Definition BlockType.h:84
Definition Block.h:43
Definition ConduitBlockActor.h:20
Definition DecoratedPotBlockActor.h:23
Definition ItemActor.h:30
Definition ItemGraphics.h:5
Definition ItemRenderer.h:5
static MCAPI void ** $vftable()
Definition ItemStack.h:26
Definition Matrix.h:10
Definition SkullBlockActor.h:19
Definition Vec3.h:10
Definition TextureGroup.h:7
Definition TexturePtr.h:19
Definition TextureUVCoordinateSet.h:5
Definition RenderMetadata.h:7