the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "EntityRenderer.h"
3
4class Textures;
5class ItemInstance;
6class Random;
7class ItemEntity;
8
9class ItemRenderer : public EntityRenderer
10{
11private:
12// TileRenderer *tileRenderer; // 4J - removed - this is shadowing the tilerenderer from entityrenderer
13 Random *random;
14 bool m_bItemFrame;
15public:
16 bool setColor;
17 float blitOffset;
18
19 ItemRenderer();
20 virtual ~ItemRenderer();
21 virtual void render(shared_ptr<Entity> _itemEntity, double x, double y, double z, float rot, float a);
22 virtual ResourceLocation *getTextureLocation(shared_ptr<Entity> entity);
23 virtual ResourceLocation *getTextureLocation(int iconType);
24
25private:
26 virtual void renderItemBillboard(shared_ptr<ItemEntity> entity, Icon *icon, int count, float a, float red, float green, float blue);
27
28public:
29 // 4J - original 2 interface variants
30 void renderGuiItem(Font *font, Textures *textures, shared_ptr<ItemInstance> item, int x, int y);
31 void renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr<ItemInstance> item, int x, int y);
32 // 4J - new interfaces added
33 void renderGuiItem(Font *font, Textures *textures, shared_ptr<ItemInstance> item, float x, float y, float fScale, float fAlpha);
34 void renderGuiItem(Font *font, Textures *textures, shared_ptr<ItemInstance> item, float x, float y, float fScaleX,float fScaleY, float fAlpha, bool useCompiled); // 4J Added useCompiled
35 void renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr<ItemInstance> item, float x, float y, float fScale, float fAlpha, bool isFoil);
36 void renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr<ItemInstance> item, float x, float y, float fScaleX, float fScaleY, float fAlpha, bool isFoil, bool isConstantBlended, bool useCompiled = true); // 4J - added isConstantBlended and useCompiled
37
38 // 4J Added
39 virtual void SetItemFrame(bool bSet) {m_bItemFrame=bSet;}
40
41 static const int m_iPotionStrengthBarWidth[4];
42
43private:
44 void blitGlint(int id, float x, float y, float w, float h); // 4J - changed x,y,w,h to floats
45
46public:
47 void renderGuiItemDecorations(Font *font, Textures *textures, shared_ptr<ItemInstance> item, int x, int y, float fAlpha = 1.0f);
48 void renderGuiItemDecorations(Font *font, Textures *textures, shared_ptr<ItemInstance> item, int x, int y, const wstring &countText, float fAlpha = 1.0f);
49private:
50 void fillRect(Tesselator *t, int x, int y, int w, int h, int c);
51public:
52 void blit(float x, float y, int sx, int sy, float w, float h); // 4J - changed x,y,w,h to floats
53 void blit(float x, float y, Icon *tex, float w, float h);
54};