the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 36 lines 988 B view raw
1#include "stdafx.h" 2#include "GhastRenderer.h" 3#include "GhastModel.h" 4#include "..\Minecraft.World\net.minecraft.world.entity.monster.h" 5 6ResourceLocation GhastRenderer::GHAST_LOCATION = ResourceLocation(TN_MOB_GHAST); 7ResourceLocation GhastRenderer::GHAST_SHOOTING_LOCATION = ResourceLocation(TN_MOB_GHAST_FIRE); 8 9GhastRenderer::GhastRenderer() : MobRenderer(new GhastModel(), 0.5f) 10{ 11} 12 13void GhastRenderer::scale(shared_ptr<LivingEntity> mob, float a) 14{ 15 shared_ptr<Ghast> ghast = dynamic_pointer_cast<Ghast>(mob); 16 17 float ss = (ghast->oCharge+(ghast->charge-ghast->oCharge)*a)/20.0f; 18 if (ss<0) ss = 0; 19 ss = 1/(ss*ss*ss*ss*ss*2+1); 20 float s = (8+ss)/2; 21 float hs = (8+1/ss)/2; 22 glScalef(hs, s, hs); 23 glColor4f(1, 1, 1, 1); 24} 25 26ResourceLocation *GhastRenderer::getTextureLocation(shared_ptr<Entity> mob) 27{ 28 shared_ptr<Ghast> ghast = dynamic_pointer_cast<Ghast>(mob); 29 30 if (ghast->isCharging()) 31 { 32 return &GHAST_SHOOTING_LOCATION; 33 } 34 35 return &GHAST_LOCATION; 36}