mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-03-23 18:38:13 +05:00
38 lines
1022 B
C++
38 lines
1022 B
C++
#include "stdafx.h"
|
|
#include "PigRenderer.h"
|
|
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
|
|
|
|
ResourceLocation PigRenderer::PIG_LOCATION = ResourceLocation(TN_MOB_PIG);
|
|
ResourceLocation PigRenderer::SADDLE_LOCATION = ResourceLocation(TN_MOB_SADDLE);
|
|
|
|
PigRenderer::PigRenderer(Model *model, Model *armor, float shadow) : MobRenderer(model,shadow)
|
|
{
|
|
setArmor(armor);
|
|
}
|
|
|
|
int PigRenderer::prepareArmor(shared_ptr<LivingEntity> _pig, int layer, float a)
|
|
{
|
|
// 4J - dynamic cast required because we aren't using templates/generics in our version
|
|
shared_ptr<Pig> pig = dynamic_pointer_cast<Pig>(_pig);
|
|
|
|
if (layer == 0 && pig->hasSaddle())
|
|
{
|
|
MemSect(31);
|
|
bindTexture(&SADDLE_LOCATION);
|
|
MemSect(0);
|
|
|
|
return 1;
|
|
}
|
|
|
|
return -1;
|
|
}
|
|
|
|
void PigRenderer::render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a)
|
|
{
|
|
MobRenderer::render(mob, x, y, z, rot, a);
|
|
}
|
|
|
|
ResourceLocation *PigRenderer::getTextureLocation(shared_ptr<Entity> mob)
|
|
{
|
|
return &PIG_LOCATION;
|
|
} |