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
17class Block;
18class BlockType;
21class ItemActor;
22class ItemStack;
23class Matrix;
24class SkullBlockActor;
25class Vec3;
26struct ActorRenderData;
27struct BlockGraphics;
28struct BlockTessellator;
29struct ItemGraphics;
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 _renderItemGroup(
154 ::BaseActorRenderContext& renderContext,
155 ::ItemActor& itemEntity,
156 int itemCount,
157 float scaleValue,
158 float frameAlpha,
159 bool useMatrixAsIs
160 ) const;
161
162 MCAPI void _renderShieldItem(
163 ::BaseActorRenderContext& renderContext,
164 ::ItemStack const& item,
165 ::ItemActor& itemEntity,
166 float actorFrameAlpha
167 );
168
169 MCAPI void forceGraphicsLoad();
170
171 MCAPI ::ItemGraphics& getGraphics(::ItemStack const& item);
172
173 MCAPI void iconBlit(
174 ::BaseActorRenderContext& renderContext,
175 ::mce::TexturePtr const& texture,
176 float x,
177 float y,
178 float z,
179 ::TextureUVCoordinateSet const& iconTextureCoord,
180 float w,
181 float h,
182 float lightMultiplier,
183 float alphaMultiplier,
184 int colorMultiplier,
185 int secondaryColorMultiplier,
186 float xscale,
187 float yscale,
188 ::IconBlitGlint iconBlitGlint,
189 bool useMultiColorTextureTinting
190 );
191
192 MCAPI void renderGuiItemInChunk(
193 ::BaseActorRenderContext& renderContext,
194 ::ItemRenderChunkType itemRenderChunkType,
195 ::ItemStack const& item,
196 float x,
197 float y,
198 float lightMultiplier,
199 float alphaMultiplier,
200 float scale,
201 int frame,
202 bool allowAnimation,
203 int zOrder,
204 ::std::optional<::TextureUVCoordinateSet> const& customIconUVCoords
205 );
206
207 MCAPI void renderGuiItemNew(
208 ::BaseActorRenderContext& renderContext,
209 ::ItemStack const& item,
210 int frame,
211 float x,
212 float y,
213 bool renderEnchantmentFoil,
214 float transparency,
215 float lightMultiplier,
216 float scale,
217 int zOrder
218 );
219 // NOLINTEND
220
221public:
222 // constructor thunks
223 // NOLINTBEGIN
224 MCAPI void* $ctor(::std::shared_ptr<::mce::TextureGroup> textureGroup, bool supportsNewVertexFormat);
225 // NOLINTEND
226
227public:
228 // destructor thunk
229 // NOLINTBEGIN
230 MCAPI void $dtor();
231 // NOLINTEND
232
233public:
234 // virtual function thunks
235 // NOLINTBEGIN
236 MCAPI void $render(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
237 // NOLINTEND
238
239public:
240 // vftables
241 // NOLINTBEGIN
242 MCNAPI static void** $vftable();
243 // NOLINTEND
244};
Definition ActorRenderer.h:5
MCAPI void $dtor()
Definition BannerBlockActor.h:22
Definition BaseActorRenderContext.h:34
MCAPI void * $ctor()
Definition BlockType.h:84
Definition Block.h:43
Definition ConduitBlockActor.h:20
Definition DecoratedPotBlockActor.h:23
Definition ItemActor.h:29
Definition ItemRenderer.h:5
static MCAPI void ** $vftable()
Definition ItemStack.h:26
Definition Matrix.h:5
Definition SkullBlockActor.h:19
Definition Vec3.h:10
Definition TextureGroup.h:7
Definition TexturePtr.h:19
Definition ActorRenderData.h:5
Definition BlockGraphics.h:5
Definition BlockTessellator.h:5
Definition ItemGraphics.h:5
Definition TextureUVCoordinateSet.h:5
Definition RenderMetadata.h:7