the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 72 lines 2.5 kB view raw
1#pragma once 2#include "Model.h" 3#include "TileRenderer.h" 4#include "Tesselator.h" 5#include "Textures.h" 6#include "ItemInHandRenderer.h" 7#include "ResourceLocation.h" 8 9class Tile; 10class Entity; 11class Level; 12class AABB; 13class IconRegister; 14class ResourceLocation; 15 16using namespace std; 17 18class EntityRenderDispatcher; 19class Font; 20 21// 4J - this was originally a generic of type EntityRenderer<T extends Entity> 22class EntityRenderer 23{ 24 friend class PlayerRenderer; // 4J Added to allow PlayerRenderer to call renderShadow 25protected: 26 EntityRenderDispatcher *entityRenderDispatcher; 27 28private: 29 static ResourceLocation SHADOW_LOCATION; 30 31protected: 32 Model *model; // TODO 4J: Check why exactly this is here, it seems to get shadowed by classes inheriting from this by their own 33 34protected: 35 TileRenderer *tileRenderer; // 4J - changed to protected so derived classes can use instead of shadowing their own 36 37protected: 38 float shadowRadius; 39 float shadowStrength; 40 41public: 42 EntityRenderer(); // 4J - added 43 virtual ~EntityRenderer(); 44public: 45 virtual void render(shared_ptr<Entity> entity, double x, double y, double z, float rot, float a) = 0; 46protected: 47 virtual void bindTexture(shared_ptr<Entity> entity); 48 virtual void bindTexture(ResourceLocation *location); 49 virtual bool bindTexture(const wstring& urlTexture, int backupTexture); 50 virtual bool bindTexture(const wstring& urlTexture, const wstring& backupTexture); 51 52 virtual ResourceLocation *getTextureLocation(shared_ptr<Entity> mob); 53private: 54 virtual void renderFlame(shared_ptr<Entity> e, double x, double y, double z, float a); 55 virtual void renderShadow(shared_ptr<Entity> e, double x, double y, double z, float pow, float a); 56 57 virtual Level *getLevel(); 58 virtual void renderTileShadow(Tile *tt, double x, double y, double z, int xt, int yt, int zt, float pow, float r, double xo, double yo, double zo); 59public: 60 virtual void render(AABB *bb, double xo, double yo, double zo); 61 static void renderFlat(AABB *bb); 62 static void renderFlat(float x0, float y0, float z0, float x1, float y1, float z1); 63 virtual void init(EntityRenderDispatcher *entityRenderDispatcher); 64 virtual void postRender(shared_ptr<Entity> entity, double x, double y, double z, float rot, float a, bool bRenderPlayerShadow); 65 virtual Font *getFont(); 66 virtual void registerTerrainTextures(IconRegister *iconRegister); 67 68public: 69 // 4J Added 70 virtual Model *getModel() { return model; } 71 virtual void SetItemFrame(bool bSet) {} 72};