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